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

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

git-svn-id: https://develop.svn.wordpress.org/trunk@33860 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-09-02 18:03:10 +00:00
parent a505ad3382
commit 0299c00fbb
1 changed files with 7 additions and 2 deletions

View File

@ -8,8 +8,13 @@
/** WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );
if ( !current_user_can('edit_posts') )
wp_die( __( 'Cheatin’ uh?' ), 403 );
if ( ! current_user_can( 'edit_posts' ) ) {
wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit comments.' ) . '</p>',
403
);
}
$wp_list_table = _get_list_table('WP_Comments_List_Table');
$pagenum = $wp_list_table->get_pagenum();