mirror of
git://develop.git.wordpress.org/
synced 2025-02-26 09:33:46 +01:00
Provide more helpful feedback than just "Cheatin' uh?" for permission errors in wp-admin/post-new.php
.
props ericlewis, kraftbj, lukecarbis, mrmist. fixes #33675. see #14530. git-svn-id: https://develop.svn.wordpress.org/trunk@33864 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2dcbf39e2d
commit
89fca37568
@ -54,8 +54,13 @@ $title = $post_type_object->labels->add_new_item;
|
||||
|
||||
$editing = true;
|
||||
|
||||
if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ), 403 );
|
||||
if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) {
|
||||
wp_die(
|
||||
'<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
|
||||
'<p>' . __( 'You are not allowed to create posts as this user.' ) . '</p>',
|
||||
403
|
||||
);
|
||||
}
|
||||
|
||||
// Schedule auto-draft cleanup
|
||||
if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user