mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Add option_page_capability_$option_page filter. see #14365.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7ab14c5ae3
commit
40b0b6c65e
@ -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…
Reference in New Issue
Block a user