mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
Provide more helpful feedback than just "Cheatin' uh?" for permission errors in wp-admin/options.php.
props ericlewis, kraftbj, lukecarbis, mrmist. fixes #33674. see #14530. git-svn-id: https://develop.svn.wordpress.org/trunk@33863 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -44,8 +44,13 @@ if ( empty($option_page) ) {
|
||||
$capability = apply_filters( "option_page_capability_{$option_page}", $capability );
|
||||
}
|
||||
|
||||
if ( !current_user_can( $capability ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ), 403 );
|
||||
if ( ! current_user_can( $capability ) ) {
|
||||
wp_die(
|
||||
'<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
|
||||
'<p>' . __( 'You are not allowed to manage these items.' ) . '</p>',
|
||||
403
|
||||
);
|
||||
}
|
||||
|
||||
// Handle admin email change requests
|
||||
if ( is_multisite() ) {
|
||||
@@ -68,8 +73,13 @@ if ( is_multisite() ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_multisite() && !is_super_admin() && 'update' != $action )
|
||||
wp_die( __( 'Cheatin’ uh?' ), 403 );
|
||||
if ( is_multisite() && ! is_super_admin() && 'update' != $action ) {
|
||||
wp_die(
|
||||
'<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
|
||||
'<p>' . __( 'You are not allowed to delete these items.' ) . '</p>',
|
||||
403
|
||||
);
|
||||
}
|
||||
|
||||
$whitelist_options = array(
|
||||
'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG' ),
|
||||
|
||||
Reference in New Issue
Block a user