From 89fca375683af4ab1486694d4d4c441459bc8727 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 2 Sep 2015 18:35:05 +0000 Subject: [PATCH] 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 --- src/wp-admin/post-new.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/post-new.php b/src/wp-admin/post-new.php index 74f81fba89..0c84608ba2 100644 --- a/src/wp-admin/post-new.php +++ b/src/wp-admin/post-new.php @@ -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( + '

' . __( 'Cheatin’ uh?' ) . '

' . + '

' . __( 'You are not allowed to create posts as this user.' ) . '

', + 403 + ); +} // Schedule auto-draft cleanup if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )