mirror of
git://develop.git.wordpress.org/
synced 2025-02-26 17:42:26 +01:00
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
This commit is contained in:
parent
708cd13d77
commit
190561b89d
@ -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(
|
||||
'<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
|
||||
'<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>',
|
||||
403
|
||||
);
|
||||
}
|
||||
|
||||
$widgets_access = get_user_setting( 'widgets_access' );
|
||||
if ( isset($_GET['widgets-access']) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user