From dfceba6d0535f0623d4936158d63c4cb482b0a59 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 4 Sep 2015 03:39:33 +0000 Subject: [PATCH] Provide more helpful feedback than just "Cheatin' uh?" for permission errors in `wp-admin/js/customize-controls.js`. fixes #33685. see #14530. git-svn-id: https://develop.svn.wordpress.org/trunk@33902 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/customize-controls.css | 10 ++++++++++ src/wp-admin/js/customize-controls.js | 5 ++++- src/wp-includes/script-loader.php | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/css/customize-controls.css b/src/wp-admin/css/customize-controls.css index 46c4170bff..c73cd6c3dc 100644 --- a/src/wp-admin/css/customize-controls.css +++ b/src/wp-admin/css/customize-controls.css @@ -1208,6 +1208,16 @@ body.cheatin { box-shadow: 0 1px 3px rgba(0,0,0,0.13); } +body.cheatin h1 { + border-bottom: 1px solid #dadada; + clear: both; + color: #666; + font: 24px "Open Sans", sans-serif; + margin: 30px 0 0 0; + padding: 0; + padding-bottom: 7px; +} + body.cheatin p { font-size: 14px; line-height: 1.5; diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index b3b44333b2..1fdbd15d4c 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -3028,7 +3028,10 @@ }, cheatin: function() { - $( document.body ).empty().addClass('cheatin').append( '

' + api.l10n.cheatin + '

' ); + $( document.body ).empty().addClass( 'cheatin' ).append( + '

' + api.l10n.cheatin + '

' + + '

' + api.l10n.notAllowed + '

' + ); }, refreshNonces: function() { diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index e3460a22eb..e3ee0ce1b0 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -428,6 +428,7 @@ function wp_default_scripts( &$scripts ) { 'cancel' => __( 'Cancel' ), 'close' => __( 'Close' ), 'cheatin' => __( 'Cheatin’ uh?' ), + 'notAllowed' => __( 'You are not allowed to customize the appearance of this site.' ), 'previewIframeTitle' => __( 'Site Preview' ), 'loginIframeTitle' => __( 'Session expired' ), 'collapseSidebar' => __( 'Collapse Sidebar' ),