add_option_whitelist( array $new_options, string|array $options = '' )
Adds an array of options to the options whitelist.
Description Description
Parameters Parameters
- $new_options
-
(array) (Required)
- $options
-
(string|array) (Optional)
Default value: ''
Return Return
(array)
Source Source
File: wp-admin/includes/plugin.php
function add_option_whitelist( $new_options, $options = '' ) { if ( $options == '' ) { global $whitelist_options; } else { $whitelist_options = $options; } foreach ( $new_options as $page => $keys ) { foreach ( $keys as $key ) { if ( ! isset( $whitelist_options[ $page ] ) || ! is_array( $whitelist_options[ $page ] ) ) { $whitelist_options[ $page ] = array(); $whitelist_options[ $page ][] = $key; } else { $pos = array_search( $key, $whitelist_options[ $page ] ); if ( $pos === false ) { $whitelist_options[ $page ][] = $key; } } } } return $whitelist_options; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Here’s a nice little tutorial that uses add_option_wp_whitelist: http://wpmututorials.com/how-to/writing-plugins/