From 190561b89de2d6ac2c2ed107501a911a4a0f4074 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 3 Sep 2015 08:55:53 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@33886 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/widgets.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/widgets.php b/src/wp-admin/widgets.php index 679f1032b0..0b603ea256 100644 --- a/src/wp-admin/widgets.php +++ b/src/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']) ) {