Add option_page_capability_$option_page filter. see #14365.
git-svn-id: https://develop.svn.wordpress.org/trunk@17986 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
43d52dea87
commit
b25c4e7cb3
@ -24,10 +24,14 @@ $parent_file = 'options-general.php';
|
||||
|
||||
wp_reset_vars(array('action', 'option_page'));
|
||||
|
||||
$capability = 'manage_options';
|
||||
|
||||
if ( empty($option_page) ) // This is for back compat and will eventually be removed.
|
||||
$option_page = 'options';
|
||||
else
|
||||
$capability = apply_filters( "option_page_capability_{$option_page}", $capability );
|
||||
|
||||
if ( !current_user_can('manage_options') )
|
||||
if ( !current_user_can( $capability ) )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
// Handle admin email change requests
|
||||
|
Loading…
x
Reference in New Issue
Block a user