Provide more helpful feedback than just "Cheatin' uh?" for permission errors in `wp-admin/widgets.php`.

props ericlewis, kraftbj, lukecarbis, mrmist.
fixes #33680. see #14530.
Built from https://develop.svn.wordpress.org/trunk@33886


git-svn-id: http://core.svn.wordpress.org/trunk@33855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-09-03 08:56:24 +00:00
parent ce05b02a59
commit c4ce11422c
2 changed files with 8 additions and 3 deletions

View File

@ -12,8 +12,13 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
/** WordPress Administration Widgets API */
require_once(ABSPATH . 'wp-admin/includes/widgets.php');
if ( ! current_user_can('edit_theme_options') )
wp_die( __( 'Cheatin’ uh?' ), 403 );
if ( ! current_user_can( 'edit_theme_options' ) ) {
wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>',
403
);
}
$widgets_access = get_user_setting( 'widgets_access' );
if ( isset($_GET['widgets-access']) ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-33885';
$wp_version = '4.4-alpha-33886';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.