From c4ce11422cc0a371b41a88dc984d3df59406cabd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 3 Sep 2015 08:56:24 +0000 Subject: [PATCH] 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 --- wp-admin/widgets.php | 9 +++++++-- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index 679f1032b0..0b603ea256 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -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( + '

' . __( 'Cheatin’ uh?' ) . '

' . + '

' . __( 'You are not allowed to edit theme options on this site.' ) . '

', + 403 + ); +} $widgets_access = get_user_setting( 'widgets_access' ); if ( isset($_GET['widgets-access']) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 33bc34382b..b774423c2b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.