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:
nacin 2011-05-22 21:32:22 +00:00
parent 7ab14c5ae3
commit 40b0b6c65e
1 changed files with 5 additions and 1 deletions

View File

@ -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