remove_option_whitelist

Removes a list of options from the options whitelist.

Description

(array) remove_option_whitelist( (array) $del_options, (string) $options = '' ); 

Returns (array)

Parameters (2)

0. $del_options (array)
The del options.
1. $options — Optional. (string) => ''
The options.

Usage

  1. if ( !function_exists( 'remove_option_whitelist' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/plugin.php'; 
  3.  
  4. // The del options. 
  5. $del_options = array(); 
  6.  
  7. // The options. 
  8. $options = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = remove_option_whitelist($del_options, $options); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/plugin.php  
  1. function remove_option_whitelist( $del_options, $options = '' ) { 
  2. if ( $options == '' ) 
  3. global $whitelist_options; 
  4. else 
  5. $whitelist_options = $options; 
  6.  
  7. foreach ( $del_options as $page => $keys ) { 
  8. foreach ( $keys as $key ) { 
  9. if ( isset($whitelist_options[ $page ]) && is_array($whitelist_options[ $page ]) ) { 
  10. $pos = array_search( $key, $whitelist_options[ $page ] ); 
  11. if ( $pos !== false ) 
  12. unset( $whitelist_options[ $page ][ $pos ] ); 
  13.  
  14. return $whitelist_options;