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:
parent
b136b074bf
commit
5ceecc4eaf
|
@ -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(
|
||||
'<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
|
||||
'<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>',
|
||||
403
|
||||
);
|
||||
}
|
||||
|
||||
wp_enqueue_script( 'nav-menu' );
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @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.
|
||||
|
|
Loading…
Reference in New Issue