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:
Andrew Nacin 2011-05-22 21:32:22 +00:00
parent 43d52dea87
commit b25c4e7cb3
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