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.
Built from https://develop.svn.wordpress.org/trunk@33862


git-svn-id: http://core.svn.wordpress.org/trunk@33830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-09-02 18:21:21 +00:00
parent b136b074bf
commit 5ceecc4eaf
2 changed files with 8 additions and 3 deletions

View File

@ -19,8 +19,13 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets'
wp_die( __( 'Your theme does not support navigation menus or widgets.' ) ); wp_die( __( 'Your theme does not support navigation menus or widgets.' ) );
// Permissions Check // Permissions Check
if ( ! current_user_can('edit_theme_options') ) if ( ! current_user_can( 'edit_theme_options' ) ) {
wp_die( __( 'Cheatin’ uh?' ), 403 ); wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>',
403
);
}
wp_enqueue_script( 'nav-menu' ); wp_enqueue_script( 'nav-menu' );

View File

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