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:
parent
a880c5c576
commit
d5ac2bc41e
|
@ -54,8 +54,13 @@ $title = $post_type_object->labels->add_new_item;
|
||||||
|
|
||||||
$editing = true;
|
$editing = true;
|
||||||
|
|
||||||
if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) )
|
if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) {
|
||||||
wp_die( __( 'Cheatin’ uh?' ), 403 );
|
wp_die(
|
||||||
|
'<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
|
||||||
|
'<p>' . __( 'You are not allowed to create posts as this user.' ) . '</p>',
|
||||||
|
403
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Schedule auto-draft cleanup
|
// Schedule auto-draft cleanup
|
||||||
if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
|
if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue