Fix warning. fixes #8448
git-svn-id: https://develop.svn.wordpress.org/trunk@10052 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3bc3fc2f53
commit
987580e03f
@ -1011,9 +1011,14 @@ function add_option_whitelist( $new_options, $options = '' ) {
|
||||
}
|
||||
foreach( $new_options as $page => $keys ) {
|
||||
foreach( $keys as $key ) {
|
||||
$pos = array_search( $key, $whitelist_options[ $page ] );
|
||||
if( $pos === false )
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user