Provide more helpful feedback than just "Cheatin' uh?" for permission errors in wp-admin/customize.php.

props ericlewis, kraftbj, lukecarbis, mrmist.
fixes #33668. see #14530.

git-svn-id: https://develop.svn.wordpress.org/trunk@33857 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-09-02 17:05:01 +00:00
parent 2ffd8b52cf
commit 1ec4b77ac2

View File

@ -13,7 +13,11 @@ define( 'IFRAME_REQUEST', true );
require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'customize' ) ) {
wp_die( __( 'Cheatin’ uh?' ), 403 );
wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to customize the appearance of this site.' ) . '</p>',
403
);
}
wp_reset_vars( array( 'url', 'return' ) );