From 40b0b6c65ecdc0c448900d6e2754aafdb3fd856a Mon Sep 17 00:00:00 2001 From: nacin Date: Sun, 22 May 2011 21:32:22 +0000 Subject: [PATCH] Add option_page_capability_$option_page filter. see #14365. git-svn-id: http://svn.automattic.com/wordpress/trunk@17986 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/options.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/options.php b/wp-admin/options.php index 4eec82019c..069dcb90f4 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -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