From 31caf44a246d9a23d3d6ba3fc3a16a1b3bc6a7b7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 2 Sep 2015 18:20:53 +0000 Subject: [PATCH] Provide more helpful feedback than just "Cheatin' uh?" for permission errors in `wp-admin/nav-menus.php`. props ericlewis, kraftbj, lukecarbis, mrmist. fixes #33673. see #14530. git-svn-id: https://develop.svn.wordpress.org/trunk@33862 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/nav-menus.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/nav-menus.php b/src/wp-admin/nav-menus.php index c5fde9044a..941951356d 100644 --- a/src/wp-admin/nav-menus.php +++ b/src/wp-admin/nav-menus.php @@ -19,8 +19,13 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' wp_die( __( 'Your theme does not support navigation menus or widgets.' ) ); // Permissions Check -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 + ); +} wp_enqueue_script( 'nav-menu' );