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.
Built from https://develop.svn.wordpress.org/trunk@33864


git-svn-id: http://core.svn.wordpress.org/trunk@33832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-09-02 18:36:22 +00:00
parent a880c5c576
commit d5ac2bc41e
2 changed files with 8 additions and 3 deletions

View File

@ -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&#8217; 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' ) )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-33863';
$wp_version = '4.4-alpha-33864';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.