Text Changes: Unify permission error messages.

The new format looks like "Sorry, you are not allowed to <action>.". This provides a consistent experience for all error messages related to missing permissions. It also reduces the number of similar strings and allows translators to provide a consistent style in their language.

Props ramiy, Presskopp.
Fixes #34521.
Built from https://develop.svn.wordpress.org/trunk@37914


git-svn-id: http://core.svn.wordpress.org/trunk@37855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-06-29 15:16:29 +00:00
parent 0b7b8981aa
commit 25e66e4f1e
66 changed files with 196 additions and 196 deletions

View File

@ -272,7 +272,7 @@ if ( isset($plugin_page) ) {
$importer = $_GET['import']; $importer = $_GET['import'];
if ( ! current_user_can('import') ) if ( ! current_user_can('import') )
wp_die(__('You are not allowed to import.')); wp_die(__('Sorry, you are not allowed to import.'));
if ( validate_file($importer) ) { if ( validate_file($importer) ) {
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ); wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );

View File

@ -45,7 +45,7 @@ if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action']
} }
if ( ! current_user_can( 'upload_files' ) ) { if ( ! current_user_can( 'upload_files' ) ) {
wp_die( __( 'You do not have permission to upload files.' ) ); wp_die( __( 'Sorry, you are not allowed to upload files.' ) );
} }
// just fetch the detail form for that attachment // just fetch the detail form for that attachment
@ -54,7 +54,7 @@ if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id
if ( 'attachment' != $post->post_type ) if ( 'attachment' != $post->post_type )
wp_die( __( 'Unknown post type.' ) ); wp_die( __( 'Unknown post type.' ) );
if ( ! current_user_can( 'edit_post', $id ) ) if ( ! current_user_can( 'edit_post', $id ) )
wp_die( __( 'You are not allowed to edit this item.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this item.' ) );
switch ( $_REQUEST['fetch'] ) { switch ( $_REQUEST['fetch'] ) {
case 3 : case 3 :

View File

@ -61,7 +61,7 @@ case 'editcomment' :
comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'javascript:history.go(-1)') ); comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'javascript:history.go(-1)') );
if ( !current_user_can( 'edit_comment', $comment_id ) ) if ( !current_user_can( 'edit_comment', $comment_id ) )
comment_footer_die( __('You are not allowed to edit this comment.') ); comment_footer_die( __('Sorry, you are not allowed to edit this comment.') );
if ( 'trash' == $comment->comment_approved ) if ( 'trash' == $comment->comment_approved )
comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') ); comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
@ -254,7 +254,7 @@ case 'unapprovecomment' :
if ( !$comment = get_comment($comment_id) ) if ( !$comment = get_comment($comment_id) )
comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'edit-comments.php') ); comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'edit-comments.php') );
if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
comment_footer_die( __('You are not allowed to edit comments on this post.') ); comment_footer_die( __('Sorry, you are not allowed to edit comments on this post.') );
if ( '' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') ) if ( '' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') )
$redir = wp_get_referer(); $redir = wp_get_referer();

View File

@ -966,7 +966,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
*/ */
public function admin_page() { public function admin_page() {
if ( ! current_user_can('edit_theme_options') ) if ( ! current_user_can('edit_theme_options') )
wp_die(__('You do not have permission to customize headers.')); wp_die(__('Sorry, you are not allowed to customize headers.'));
$step = $this->step(); $step = $this->step();
if ( 2 == $step ) if ( 2 == $step )
$this->step_2(); $this->step_2();

View File

@ -15,7 +15,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'customize' ) ) { if ( ! current_user_can( 'customize' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to customize this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>',
403 403
); );
} }

View File

@ -11,7 +11,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'edit_posts' ) ) { if ( ! current_user_can( 'edit_posts' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit comments.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>',
403 403
); );
} }
@ -210,7 +210,7 @@ if ( isset( $_REQUEST['error'] ) ) {
$error_msg = __( 'Invalid comment ID.' ); $error_msg = __( 'Invalid comment ID.' );
break; break;
case 2 : case 2 :
$error_msg = __( 'You are not allowed to edit comments on this post.' ); $error_msg = __( 'Sorry, you are not allowed to edit comments on this post.' );
break; break;
} }
if ( $error_msg ) if ( $error_msg )

View File

@ -18,13 +18,13 @@ if ( ! $tax )
wp_die( __( 'Invalid taxonomy' ) ); wp_die( __( 'Invalid taxonomy' ) );
if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) { if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) {
wp_die( __( 'You are not allowed to manage these items.' ) ); wp_die( __( 'Sorry, you are not allowed to manage these items.' ) );
} }
if ( ! current_user_can( $tax->cap->manage_terms ) ) { if ( ! current_user_can( $tax->cap->manage_terms ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to manage these items.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to manage these items.' ) . '</p>',
403 403
); );
} }
@ -71,7 +71,7 @@ case 'add-tag':
if ( ! current_user_can( $tax->cap->edit_terms ) ) { if ( ! current_user_can( $tax->cap->edit_terms ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to add this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to add this item.' ) . '</p>',
403 403
); );
} }
@ -111,7 +111,7 @@ case 'delete':
if ( ! current_user_can( $tax->cap->delete_terms ) ) { if ( ! current_user_can( $tax->cap->delete_terms ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to delete this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
403 403
); );
} }
@ -128,7 +128,7 @@ case 'bulk-delete':
if ( ! current_user_can( $tax->cap->delete_terms ) ) { if ( ! current_user_can( $tax->cap->delete_terms ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to delete these items.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',
403 403
); );
} }
@ -171,7 +171,7 @@ case 'editedtag':
if ( ! current_user_can( $tax->cap->edit_terms ) ) { if ( ! current_user_can( $tax->cap->edit_terms ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
403 403
); );
} }
@ -297,7 +297,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
if ( ! current_user_can( $tax->cap->edit_terms ) ) { if ( ! current_user_can( $tax->cap->edit_terms ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
403 403
); );
} }

View File

@ -13,7 +13,7 @@ if ( ! $typenow )
wp_die( __( 'Invalid post type' ) ); wp_die( __( 'Invalid post type' ) );
if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) { if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
wp_die( __( 'You are not allowed to edit posts in this post type.' ) ); wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
} }
if ( 'attachment' === $typenow ) { if ( 'attachment' === $typenow ) {
@ -37,7 +37,7 @@ if ( ! $post_type_object )
if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) { if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit posts in this post type.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '</p>',
403 403
); );
} }
@ -103,7 +103,7 @@ if ( $doaction ) {
foreach ( (array) $post_ids as $post_id ) { foreach ( (array) $post_ids as $post_id ) {
if ( !current_user_can( 'delete_post', $post_id) ) if ( !current_user_can( 'delete_post', $post_id) )
wp_die( __('You are not allowed to move this item to the Trash.') ); wp_die( __('Sorry, you are not allowed to move this item to the Trash.') );
if ( wp_check_post_lock( $post_id ) ) { if ( wp_check_post_lock( $post_id ) ) {
$locked++; $locked++;
@ -122,7 +122,7 @@ if ( $doaction ) {
$untrashed = 0; $untrashed = 0;
foreach ( (array) $post_ids as $post_id ) { foreach ( (array) $post_ids as $post_id ) {
if ( !current_user_can( 'delete_post', $post_id) ) if ( !current_user_can( 'delete_post', $post_id) )
wp_die( __('You are not allowed to restore this item from the Trash.') ); wp_die( __('Sorry, you are not allowed to restore this item from the Trash.') );
if ( !wp_untrash_post($post_id) ) if ( !wp_untrash_post($post_id) )
wp_die( __('Error in restoring from Trash.') ); wp_die( __('Error in restoring from Trash.') );
@ -137,7 +137,7 @@ if ( $doaction ) {
$post_del = get_post($post_id); $post_del = get_post($post_id);
if ( !current_user_can( 'delete_post', $post_id ) ) if ( !current_user_can( 'delete_post', $post_id ) )
wp_die( __('You are not allowed to delete this item.') ); wp_die( __('Sorry, you are not allowed to delete this item.') );
if ( $post_del->post_type == 'attachment' ) { if ( $post_del->post_type == 'attachment' ) {
if ( ! wp_delete_attachment($post_id) ) if ( ! wp_delete_attachment($post_id) )

View File

@ -10,7 +10,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( !current_user_can('export') ) if ( !current_user_can('export') )
wp_die(__('You do not have sufficient permissions to export the content of this site.')); wp_die(__('Sorry, you are not allowed to export the content of this site.'));
/** Load WordPress export API */ /** Load WordPress export API */
require_once( ABSPATH . 'wp-admin/includes/export.php' ); require_once( ABSPATH . 'wp-admin/includes/export.php' );

View File

@ -12,7 +12,7 @@ define('WP_LOAD_IMPORTERS', true);
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( !current_user_can('import') ) if ( !current_user_can('import') )
wp_die(__('You do not have sufficient permissions to import content in this site.')); wp_die(__('Sorry, you are not allowed to import content in this site.'));
$title = __('Import'); $title = __('Import');

View File

@ -1622,10 +1622,10 @@ function wp_ajax_inline_save() {
if ( 'page' == $_POST['post_type'] ) { if ( 'page' == $_POST['post_type'] ) {
if ( ! current_user_can( 'edit_page', $post_ID ) ) if ( ! current_user_can( 'edit_page', $post_ID ) )
wp_die( __( 'You are not allowed to edit this page.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this page.' ) );
} else { } else {
if ( ! current_user_can( 'edit_post', $post_ID ) ) if ( ! current_user_can( 'edit_post', $post_ID ) )
wp_die( __( 'You are not allowed to edit this post.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
} }
if ( $last = wp_check_post_lock( $post_ID ) ) { if ( $last = wp_check_post_lock( $post_ID ) ) {
@ -2020,7 +2020,7 @@ function wp_ajax_upload_attachment() {
echo wp_json_encode( array( echo wp_json_encode( array(
'success' => false, 'success' => false,
'data' => array( 'data' => array(
'message' => __( 'You do not have permission to upload files.' ), 'message' => __( 'Sorry, you are not allowed to upload files.' ),
'filename' => $_FILES['async-upload']['name'], 'filename' => $_FILES['async-upload']['name'],
) )
) ); ) );
@ -3302,7 +3302,7 @@ function wp_ajax_install_theme() {
); );
if ( ! current_user_can( 'install_themes' ) ) { if ( ! current_user_can( 'install_themes' ) ) {
$status['errorMessage'] = __( 'You do not have sufficient permissions to install themes on this site.' ); $status['errorMessage'] = __( 'Sorry, you are not allowed to install themes on this site.' );
wp_send_json_error( $status ); wp_send_json_error( $status );
} }
@ -3398,7 +3398,7 @@ function wp_ajax_update_theme() {
); );
if ( ! current_user_can( 'update_themes' ) ) { if ( ! current_user_can( 'update_themes' ) ) {
$status['errorMessage'] = __( 'You do not have sufficient permissions to update themes on this site.' ); $status['errorMessage'] = __( 'Sorry, you are not allowed to update themes on this site.' );
wp_send_json_error( $status ); wp_send_json_error( $status );
} }
@ -3476,7 +3476,7 @@ function wp_ajax_delete_theme() {
); );
if ( ! current_user_can( 'delete_themes' ) ) { if ( ! current_user_can( 'delete_themes' ) ) {
$status['errorMessage'] = __( 'You do not have sufficient permissions to delete themes on this site.' ); $status['errorMessage'] = __( 'Sorry, you are not allowed to delete themes on this site.' );
wp_send_json_error( $status ); wp_send_json_error( $status );
} }
@ -3540,7 +3540,7 @@ function wp_ajax_install_plugin() {
); );
if ( ! current_user_can( 'install_plugins' ) ) { if ( ! current_user_can( 'install_plugins' ) ) {
$status['errorMessage'] = __( 'You do not have sufficient permissions to install plugins on this site.' ); $status['errorMessage'] = __( 'Sorry, you are not allowed to install plugins on this site.' );
wp_send_json_error( $status ); wp_send_json_error( $status );
} }
@ -3638,7 +3638,7 @@ function wp_ajax_update_plugin() {
} }
if ( ! current_user_can( 'update_plugins' ) ) { if ( ! current_user_can( 'update_plugins' ) ) {
$status['errorMessage'] = __( 'You do not have sufficient permissions to update plugins for this site.' ); $status['errorMessage'] = __( 'Sorry, you are not allowed to update plugins for this site.' );
wp_send_json_error( $status ); wp_send_json_error( $status );
} }
@ -3727,7 +3727,7 @@ function wp_ajax_delete_plugin() {
); );
if ( ! current_user_can( 'delete_plugins' ) ) { if ( ! current_user_can( 'delete_plugins' ) ) {
$status['errorMessage'] = __( 'You do not have sufficient permissions to delete plugins for this site.' ); $status['errorMessage'] = __( 'Sorry, you are not allowed to delete plugins for this site.' );
wp_send_json_error( $status ); wp_send_json_error( $status );
} }
@ -3787,7 +3787,7 @@ function wp_ajax_search_plugins() {
$status = array(); $status = array();
if ( ! $wp_list_table->ajax_user_can() ) { if ( ! $wp_list_table->ajax_user_can() ) {
$status['errorMessage'] = __( 'You do not have sufficient permissions to manage plugins on this site.' ); $status['errorMessage'] = __( 'Sorry, you are not allowed to manage plugins for this site.' );
wp_send_json_error( $status ); wp_send_json_error( $status );
} }
@ -3827,7 +3827,7 @@ function wp_ajax_search_install_plugins() {
$status = array(); $status = array();
if ( ! $wp_list_table->ajax_user_can() ) { if ( ! $wp_list_table->ajax_user_can() ) {
$status['errorMessage'] = __( 'You do not have sufficient permissions to manage plugins on this site.' ); $status['errorMessage'] = __( 'Sorry, you are not allowed to manage plugins on this site.' );
wp_send_json_error( $status ); wp_send_json_error( $status );
} }

View File

@ -29,7 +29,7 @@ function edit_link( $link_id = 0 ) {
if ( ! current_user_can( 'manage_links' ) ) { if ( ! current_user_can( 'manage_links' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You do not have sufficient permissions to edit the links for this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit the links for this site.' ) . '</p>',
403 403
); );
} }
@ -312,5 +312,5 @@ function wp_link_manager_disabled_message() {
wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) ); wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) );
} }
wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
} }

View File

@ -46,7 +46,7 @@ function comment_exists( $comment_author, $comment_date, $timezone = 'blog' ) {
*/ */
function edit_comment() { function edit_comment() {
if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) ) if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) )
wp_die ( __( 'You are not allowed to edit comments on this post.' ) ); wp_die ( __( 'Sorry, you are not allowed to edit comments on this post.' ) );
if ( isset( $_POST['newcomment_author'] ) ) if ( isset( $_POST['newcomment_author'] ) )
$_POST['comment_author'] = $_POST['newcomment_author']; $_POST['comment_author'] = $_POST['newcomment_author'];

View File

@ -3121,7 +3121,7 @@ function wp_media_attach_action( $parent_id, $action = 'attach' ) {
} }
if ( ! current_user_can( 'edit_post', $parent_id ) ) { if ( ! current_user_can( 'edit_post', $parent_id ) ) {
wp_die( __( 'You are not allowed to edit this post.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
} }
$ids = array(); $ids = array();
foreach ( (array) $_REQUEST['media'] as $att_id ) { foreach ( (array) $_REQUEST['media'] as $att_id ) {

View File

@ -339,7 +339,7 @@ if ( !user_can_access_admin_page() ) {
*/ */
do_action( 'admin_page_access_denied' ); do_action( 'admin_page_access_denied' );
wp_die( __( 'You do not have sufficient permissions to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
} }
$menu = add_menu_classes($menu); $menu = add_menu_classes($menu);

View File

@ -30,14 +30,14 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
if ( $update && ! current_user_can( 'edit_post', $post_data['ID'] ) ) { if ( $update && ! current_user_can( 'edit_post', $post_data['ID'] ) ) {
if ( 'page' == $post_data['post_type'] ) if ( 'page' == $post_data['post_type'] )
return new WP_Error( 'edit_others_pages', __( 'You are not allowed to edit pages as this user.' ) ); return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );
else else
return new WP_Error( 'edit_others_posts', __( 'You are not allowed to edit posts as this user.' ) ); return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to edit posts as this user.' ) );
} elseif ( ! $update && ! current_user_can( $ptype->cap->create_posts ) ) { } elseif ( ! $update && ! current_user_can( $ptype->cap->create_posts ) ) {
if ( 'page' == $post_data['post_type'] ) if ( 'page' == $post_data['post_type'] )
return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) ); return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to create pages as this user.' ) );
else else
return new WP_Error( 'edit_others_posts', __( 'You are not allowed to create posts as this user.' ) ); return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to create posts as this user.' ) );
} }
if ( isset( $post_data['content'] ) ) if ( isset( $post_data['content'] ) )
@ -68,14 +68,14 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
&& ! current_user_can( $ptype->cap->edit_others_posts ) ) { && ! current_user_can( $ptype->cap->edit_others_posts ) ) {
if ( $update ) { if ( $update ) {
if ( 'page' == $post_data['post_type'] ) if ( 'page' == $post_data['post_type'] )
return new WP_Error( 'edit_others_pages', __( 'You are not allowed to edit pages as this user.' ) ); return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );
else else
return new WP_Error( 'edit_others_posts', __( 'You are not allowed to edit posts as this user.' ) ); return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to edit posts as this user.' ) );
} else { } else {
if ( 'page' == $post_data['post_type'] ) if ( 'page' == $post_data['post_type'] )
return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) ); return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to create pages as this user.' ) );
else else
return new WP_Error( 'edit_others_posts', __( 'You are not allowed to create posts as this user.' ) ); return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to create posts as this user.' ) );
} }
} }
@ -210,9 +210,9 @@ function edit_post( $post_data = null ) {
$ptype = get_post_type_object($post_data['post_type']); $ptype = get_post_type_object($post_data['post_type']);
if ( !current_user_can( 'edit_post', $post_ID ) ) { if ( !current_user_can( 'edit_post', $post_ID ) ) {
if ( 'page' == $post_data['post_type'] ) if ( 'page' == $post_data['post_type'] )
wp_die( __('You are not allowed to edit this page.' )); wp_die( __('Sorry, you are not allowed to edit this page.' ));
else else
wp_die( __('You are not allowed to edit this post.' )); wp_die( __('Sorry, you are not allowed to edit this post.' ));
} }
if ( post_type_supports( $ptype->name, 'revisions' ) ) { if ( post_type_supports( $ptype->name, 'revisions' ) ) {
@ -428,9 +428,9 @@ function bulk_edit_posts( $post_data = null ) {
if ( !current_user_can( $ptype->cap->edit_posts ) ) { if ( !current_user_can( $ptype->cap->edit_posts ) ) {
if ( 'page' == $ptype->name ) if ( 'page' == $ptype->name )
wp_die( __('You are not allowed to edit pages.')); wp_die( __('Sorry, you are not allowed to edit pages.'));
else else
wp_die( __('You are not allowed to edit posts.')); wp_die( __('Sorry, you are not allowed to edit posts.'));
} }
if ( -1 == $post_data['_status'] ) { if ( -1 == $post_data['_status'] ) {
@ -721,9 +721,9 @@ function wp_write_post() {
if ( !current_user_can( $ptype->cap->edit_posts ) ) { if ( !current_user_can( $ptype->cap->edit_posts ) ) {
if ( 'page' == $ptype->name ) if ( 'page' == $ptype->name )
return new WP_Error( 'edit_pages', __( 'You are not allowed to create pages on this site.' ) ); return new WP_Error( 'edit_pages', __( 'Sorry, you are not allowed to create pages on this site.' ) );
else else
return new WP_Error( 'edit_posts', __( 'You are not allowed to create posts or drafts on this site.' ) ); return new WP_Error( 'edit_posts', __( 'Sorry, you are not allowed to create posts or drafts on this site.' ) );
} }
$_POST['post_mime_type'] = ''; $_POST['post_mime_type'] = '';
@ -1724,11 +1724,11 @@ function post_preview() {
$_POST['ID'] = $post_ID; $_POST['ID'] = $post_ID;
if ( ! $post = get_post( $post_ID ) ) { if ( ! $post = get_post( $post_ID ) ) {
wp_die( __( 'You are not allowed to edit this post.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
} }
if ( ! current_user_can( 'edit_post', $post->ID ) ) { if ( ! current_user_can( 'edit_post', $post->ID ) ) {
wp_die( __( 'You are not allowed to edit this post.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
} }
$is_autosave = false; $is_autosave = false;
@ -1786,7 +1786,7 @@ function wp_autosave( $post_data ) {
$post = get_post( $post_id ); $post = get_post( $post_id );
if ( ! current_user_can( 'edit_post', $post->ID ) ) { if ( ! current_user_can( 'edit_post', $post->ID ) ) {
return new WP_Error( 'edit_posts', __( 'You are not allowed to edit this item.' ) ); return new WP_Error( 'edit_posts', __( 'Sorry, you are not allowed to edit this item.' ) );
} }
if ( 'auto-draft' == $post->post_status ) if ( 'auto-draft' == $post->post_status )

View File

@ -10,7 +10,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can('manage_links') ) if ( ! current_user_can('manage_links') )
wp_die(__('You do not have sufficient permissions to add links to this site.')); wp_die(__('Sorry, you are not allowed to add links to this site.'));
$title = __('Add New Link'); $title = __('Add New Link');
$parent_file = 'link-manager.php'; $parent_file = 'link-manager.php';

View File

@ -9,7 +9,7 @@
/** Load WordPress Administration Bootstrap */ /** Load WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'manage_links' ) ) if ( ! current_user_can( 'manage_links' ) )
wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
$wp_list_table = _get_list_table('WP_Links_List_Table'); $wp_list_table = _get_list_table('WP_Links_List_Table');
@ -68,7 +68,7 @@ get_current_screen()->set_screen_reader_content( array(
include_once( ABSPATH . 'wp-admin/admin-header.php' ); include_once( ABSPATH . 'wp-admin/admin-header.php' );
if ( ! current_user_can('manage_links') ) if ( ! current_user_can('manage_links') )
wp_die(__("You do not have sufficient permissions to edit the links for this site.")); wp_die(__('Sorry, you are not allowed to edit the links for this site.'));
?> ?>

View File

@ -13,7 +13,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if (!current_user_can('upload_files')) if (!current_user_can('upload_files'))
wp_die(__('You do not have permission to upload files.')); wp_die(__('Sorry, you are not allowed to upload files.'));
wp_enqueue_script('plupload-handlers'); wp_enqueue_script('plupload-handlers');

View File

@ -16,7 +16,7 @@ if ( ! isset( $_GET['inline'] ) )
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'upload_files' ) ) { if ( ! current_user_can( 'upload_files' ) ) {
wp_die( __( 'You do not have permission to upload files.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to upload files.' ), 403 );
} }
wp_enqueue_script('plupload-handlers'); wp_enqueue_script('plupload-handlers');
@ -43,7 +43,7 @@ if ( isset( $action ) && $action == 'edit' && !$ID ) {
if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) ) { if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
403 403
); );
} }

View File

@ -20,7 +20,7 @@ case 'editattachment' :
check_admin_referer('media-form'); check_admin_referer('media-form');
if ( !current_user_can('edit_post', $attachment_id) ) if ( !current_user_can('edit_post', $attachment_id) )
wp_die ( __('You are not allowed to edit this attachment.') ); wp_die ( __('Sorry, you are not allowed to edit this attachment.') );
$errors = media_upload_form_handler(); $errors = media_upload_form_handler();
@ -54,7 +54,7 @@ case 'edit' :
$att_id = (int) $_GET['attachment_id']; $att_id = (int) $_GET['attachment_id'];
if ( !current_user_can('edit_post', $att_id) ) if ( !current_user_can('edit_post', $att_id) )
wp_die ( __('You are not allowed to edit this attachment.') ); wp_die ( __('Sorry, you are not allowed to edit this attachment.') );
$att = get_post($att_id); $att = get_post($att_id);

View File

@ -13,7 +13,7 @@ if ( !is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'delete_site' ) ) if ( ! current_user_can( 'delete_site' ) )
wp_die(__( 'You do not have sufficient permissions to delete this site.')); wp_die(__( 'Sorry, you are not allowed to delete this site.'));
if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) { if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) {
if ( get_option( 'delete_blog_hash' ) == $_GET['h'] ) { if ( get_option( 'delete_blog_hash' ) == $_GET['h'] ) {

View File

@ -13,7 +13,7 @@ if ( !is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can('read') ) if ( ! current_user_can('read') )
wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); wp_die( __( 'Sorry, you are not allowed to access this page.' ) );
$action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash'; $action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash';

View File

@ -22,7 +22,7 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets'
if ( ! current_user_can( 'edit_theme_options' ) ) { if ( ! current_user_can( 'edit_theme_options' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
403 403
); );
} }

View File

@ -16,7 +16,7 @@ define( 'WP_INSTALLING_NETWORK', true );
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! is_super_admin() ) { if ( ! is_super_admin() ) {
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
} }
if ( is_multisite() ) { if ( is_multisite() ) {

View File

@ -17,7 +17,7 @@ if ( !is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_network' ) ) if ( ! current_user_can( 'manage_network' ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
$title = __( 'Dashboard' ); $title = __( 'Dashboard' );
$parent_file = 'index.php'; $parent_file = 'index.php';

View File

@ -17,7 +17,7 @@ if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_network_options' ) ) if ( ! current_user_can( 'manage_network_options' ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
$title = __( 'Network Settings' ); $title = __( 'Network Settings' );
$parent_file = 'settings.php'; $parent_file = 'settings.php';

View File

@ -15,7 +15,7 @@ if ( ! is_multisite() ) {
} }
if ( ! current_user_can( 'manage_sites' ) ) { if ( ! current_user_can( 'manage_sites' ) ) {
wp_die( __( 'You do not have sufficient permissions to edit this site.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
} }
get_current_screen()->add_help_tab( array( get_current_screen()->add_help_tab( array(
@ -47,7 +47,7 @@ if ( ! $details ) {
} }
if ( ! can_edit_network( $details->site_id ) ) { if ( ! can_edit_network( $details->site_id ) ) {
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
} }
$parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME ); $parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME );

View File

@ -17,7 +17,7 @@ if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) ) if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have sufficient permissions to add sites to this network.' ) ); wp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) );
get_current_screen()->add_help_tab( array( get_current_screen()->add_help_tab( array(
'id' => 'overview', 'id' => 'overview',

View File

@ -14,7 +14,7 @@ if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) ) if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have sufficient permissions to edit this site.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
get_current_screen()->add_help_tab( array( get_current_screen()->add_help_tab( array(
'id' => 'overview', 'id' => 'overview',
@ -44,7 +44,7 @@ if ( ! $details ) {
} }
if ( !can_edit_network( $details->site_id ) ) if ( !can_edit_network( $details->site_id ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
$is_main_site = is_main_site( $id ); $is_main_site = is_main_site( $id );

View File

@ -14,7 +14,7 @@ if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) ) if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) );
get_current_screen()->add_help_tab( array( get_current_screen()->add_help_tab( array(
'id' => 'overview', 'id' => 'overview',
@ -67,7 +67,7 @@ if ( ! $details ) {
} }
if ( !can_edit_network( $details->site_id ) ) if ( !can_edit_network( $details->site_id ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
$is_main_site = is_main_site( $id ); $is_main_site = is_main_site( $id );

View File

@ -14,7 +14,7 @@ if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can('manage_sites') ) if ( ! current_user_can('manage_sites') )
wp_die(__('You do not have sufficient permissions to edit this site.')); wp_die(__('Sorry, you are not allowed to edit this site.'));
$wp_list_table = _get_list_table('WP_Users_List_Table'); $wp_list_table = _get_list_table('WP_Users_List_Table');
$wp_list_table->prepare_items(); $wp_list_table->prepare_items();
@ -60,7 +60,7 @@ if ( ! $details ) {
} }
if ( ! can_edit_network( $details->site_id ) ) if ( ! can_edit_network( $details->site_id ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
$is_main_site = is_main_site( $id ); $is_main_site = is_main_site( $id );

View File

@ -14,7 +14,7 @@ if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) ) if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
$wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' ); $wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' );
$pagenum = $wp_list_table->get_pagenum(); $pagenum = $wp_list_table->get_pagenum();
@ -91,7 +91,7 @@ if ( isset( $_GET['action'] ) ) {
} }
if ( $current_site->blog_id == $id ) { if ( $current_site->blog_id == $id ) {
wp_die( __( 'You are not allowed to change the current site.' ) ); wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
} }
$site_details = get_blog_details( $id ); $site_details = get_blog_details( $id );
@ -126,7 +126,7 @@ if ( isset( $_GET['action'] ) ) {
case 'deleteblog': case 'deleteblog':
if ( ! current_user_can( 'delete_sites' ) ) if ( ! current_user_can( 'delete_sites' ) )
wp_die( __( 'You do not have permission to access this page.' ), '', array( 'response' => 403 ) ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), '', array( 'response' => 403 ) );
$updated_action = 'not_deleted'; $updated_action = 'not_deleted';
if ( $id != '0' && $id != $current_site->blog_id && current_user_can( 'delete_site', $id ) ) { if ( $id != '0' && $id != $current_site->blog_id && current_user_can( 'delete_site', $id ) ) {
@ -144,7 +144,7 @@ if ( isset( $_GET['action'] ) ) {
switch ( $doaction ) { switch ( $doaction ) {
case 'delete': case 'delete':
if ( ! current_user_can( 'delete_site', $val ) ) if ( ! current_user_can( 'delete_site', $val ) )
wp_die( __( 'You are not allowed to delete the site.' ) ); wp_die( __( 'Sorry, you are not allowed to delete the site.' ) );
$updated_action = 'all_delete'; $updated_action = 'all_delete';
wpmu_delete_blog( $val, true ); wpmu_delete_blog( $val, true );
@ -157,7 +157,7 @@ if ( isset( $_GET['action'] ) ) {
break; break;
} }
} else { } else {
wp_die( __( 'You are not allowed to change the current site.' ) ); wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
} }
} }
} else { } else {
@ -237,7 +237,7 @@ if ( isset( $_GET['updated'] ) ) {
$msg = __( 'Site deleted.' ); $msg = __( 'Site deleted.' );
break; break;
case 'not_deleted': case 'not_deleted':
$msg = __( 'You do not have permission to delete that site.' ); $msg = __( 'Sorry, you are not allowed to delete that site.' );
break; break;
case 'archiveblog': case 'archiveblog':
$msg = __( 'Site archived.' ); $msg = __( 'Site archived.' );

View File

@ -14,7 +14,7 @@ if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( !current_user_can('manage_network_themes') ) if ( !current_user_can('manage_network_themes') )
wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) ); wp_die( __( 'Sorry, you are not allowed to manage network themes.' ) );
$wp_list_table = _get_list_table('WP_MS_Themes_List_Table'); $wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
$pagenum = $wp_list_table->get_pagenum(); $pagenum = $wp_list_table->get_pagenum();
@ -90,7 +90,7 @@ if ( $action ) {
exit; exit;
case 'delete-selected': case 'delete-selected':
if ( ! current_user_can( 'delete_themes' ) ) { if ( ! current_user_can( 'delete_themes' ) ) {
wp_die( __('You do not have sufficient permissions to delete themes for this site.') ); wp_die( __('Sorry, you are not allowed to delete themes for this site.') );
} }
check_admin_referer( 'bulk-themes' ); check_admin_referer( 'bulk-themes' );

View File

@ -36,7 +36,7 @@ get_current_screen()->set_help_sidebar(
require_once( ABSPATH . 'wp-admin/admin-header.php' ); require_once( ABSPATH . 'wp-admin/admin-header.php' );
if ( ! current_user_can( 'manage_network' ) ) if ( ! current_user_can( 'manage_network' ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
echo '<div class="wrap">'; echo '<div class="wrap">';
echo '<h1>' . __( 'Upgrade Network' ) . '</h1>'; echo '<h1>' . __( 'Upgrade Network' ) . '</h1>';

View File

@ -14,7 +14,7 @@ if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can('create_users') ) if ( ! current_user_can('create_users') )
wp_die(__('You do not have sufficient permissions to add users to this network.')); wp_die(__('Sorry, you are not allowed to add users to this network.'));
get_current_screen()->add_help_tab( array( get_current_screen()->add_help_tab( array(
'id' => 'overview', 'id' => 'overview',
@ -34,7 +34,7 @@ if ( isset($_REQUEST['action']) && 'add-user' == $_REQUEST['action'] ) {
check_admin_referer( 'add-user', '_wpnonce_add-user' ); check_admin_referer( 'add-user', '_wpnonce_add-user' );
if ( ! current_user_can( 'manage_network_users' ) ) if ( ! current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
if ( ! is_array( $_POST['user'] ) ) if ( ! is_array( $_POST['user'] ) )
wp_die( __( 'Cannot create an empty user.' ) ); wp_die( __( 'Cannot create an empty user.' ) );

View File

@ -14,7 +14,7 @@ if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) ); wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_network_users' ) ) if ( ! current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
if ( isset( $_GET['action'] ) ) { if ( isset( $_GET['action'] ) ) {
/** This action is documented in wp-admin/network/edit.php */ /** This action is documented in wp-admin/network/edit.php */
@ -23,7 +23,7 @@ if ( isset( $_GET['action'] ) ) {
switch ( $_GET['action'] ) { switch ( $_GET['action'] ) {
case 'deleteuser': case 'deleteuser':
if ( ! current_user_can( 'manage_network_users' ) ) if ( ! current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
check_admin_referer( 'deleteuser' ); check_admin_referer( 'deleteuser' );
@ -44,7 +44,7 @@ if ( isset( $_GET['action'] ) ) {
case 'allusers': case 'allusers':
if ( !current_user_can( 'manage_network_users' ) ) if ( !current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
if ( ( isset( $_POST['action']) || isset($_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) { if ( ( isset( $_POST['action']) || isset($_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {
check_admin_referer( 'bulk-users-network' ); check_admin_referer( 'bulk-users-network' );
@ -57,7 +57,7 @@ if ( isset( $_GET['action'] ) ) {
switch ( $doaction ) { switch ( $doaction ) {
case 'delete': case 'delete':
if ( ! current_user_can( 'delete_users' ) ) if ( ! current_user_can( 'delete_users' ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
$title = __( 'Users' ); $title = __( 'Users' );
$parent_file = 'users.php'; $parent_file = 'users.php';
require_once( ABSPATH . 'wp-admin/admin-header.php' ); require_once( ABSPATH . 'wp-admin/admin-header.php' );
@ -106,7 +106,7 @@ if ( isset( $_GET['action'] ) ) {
case 'dodelete': case 'dodelete':
check_admin_referer( 'ms-users-delete' ); check_admin_referer( 'ms-users-delete' );
if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) ) if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) )
wp_die( __( 'You do not have permission to access this page.' ), 403 ); wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) { if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
foreach ( $_POST['blog'] as $id => $users ) { foreach ( $_POST['blog'] as $id => $users ) {

View File

@ -9,7 +9,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'manage_options' ) ) if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
$title = __('Discussion Settings'); $title = __('Discussion Settings');
$parent_file = 'options-general.php'; $parent_file = 'options-general.php';

View File

@ -13,7 +13,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' ); require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
if ( ! current_user_can( 'manage_options' ) ) if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
$title = __('General Settings'); $title = __('General Settings');
$parent_file = 'options-general.php'; $parent_file = 'options-general.php';

View File

@ -10,7 +10,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'manage_options' ) ) if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
$title = __('Media Settings'); $title = __('Media Settings');
$parent_file = 'options-general.php'; $parent_file = 'options-general.php';

View File

@ -10,7 +10,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'manage_options' ) ) if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
$title = __('Permalink Settings'); $title = __('Permalink Settings');
$parent_file = 'options-general.php'; $parent_file = 'options-general.php';

View File

@ -10,7 +10,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'manage_options' ) ) if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
$title = __( 'Reading Settings' ); $title = __( 'Reading Settings' );
$parent_file = 'options-general.php'; $parent_file = 'options-general.php';

View File

@ -10,7 +10,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'manage_options' ) ) if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
$title = __('Writing Settings'); $title = __('Writing Settings');
$parent_file = 'options-general.php'; $parent_file = 'options-general.php';

View File

@ -47,7 +47,7 @@ if ( empty($option_page) ) {
if ( ! current_user_can( $capability ) ) { if ( ! current_user_can( $capability ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to manage these items.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to manage these items.' ) . '</p>',
403 403
); );
} }
@ -76,7 +76,7 @@ if ( is_multisite() ) {
if ( is_multisite() && ! is_super_admin() && 'update' != $action ) { if ( is_multisite() && ! is_super_admin() && 'update' != $action ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to delete these items.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',
403 403
); );
} }
@ -160,7 +160,7 @@ if ( 'update' == $action ) {
if ( 'options' == $option_page ) { if ( 'options' == $option_page ) {
if ( is_multisite() && ! is_super_admin() ) if ( is_multisite() && ! is_super_admin() )
wp_die( __( 'You do not have sufficient permissions to modify unregistered settings for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to modify unregistered settings for this site.' ) );
$options = explode( ',', wp_unslash( $_POST[ 'page_options' ] ) ); $options = explode( ',', wp_unslash( $_POST[ 'page_options' ] ) );
} else { } else {
$options = $whitelist_options[ $option_page ]; $options = $whitelist_options[ $option_page ];

View File

@ -15,7 +15,7 @@ if ( is_multisite() && ! is_network_admin() ) {
} }
if ( !current_user_can('edit_plugins') ) if ( !current_user_can('edit_plugins') )
wp_die( __('You do not have sufficient permissions to edit plugins for this site.') ); wp_die( __('Sorry, you are not allowed to edit plugins for this site.') );
$title = __("Edit Plugins"); $title = __("Edit Plugins");
$parent_file = 'plugins.php'; $parent_file = 'plugins.php';

View File

@ -15,7 +15,7 @@ if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-informat
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can('install_plugins') ) if ( ! current_user_can('install_plugins') )
wp_die(__('You do not have sufficient permissions to install plugins on this site.')); wp_die(__('Sorry, you are not allowed to install plugins on this site.'));
if ( is_multisite() && ! is_network_admin() ) { if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'plugin-install.php' ) ); wp_redirect( network_admin_url( 'plugin-install.php' ) );

View File

@ -10,7 +10,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can('activate_plugins') ) if ( ! current_user_can('activate_plugins') )
wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to manage plugins for this site.' ) );
$wp_list_table = _get_list_table('WP_Plugins_List_Table'); $wp_list_table = _get_list_table('WP_Plugins_List_Table');
$pagenum = $wp_list_table->get_pagenum(); $pagenum = $wp_list_table->get_pagenum();
@ -30,7 +30,7 @@ if ( $action ) {
switch ( $action ) { switch ( $action ) {
case 'activate': case 'activate':
if ( ! current_user_can('activate_plugins') ) if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); wp_die(__('Sorry, you are not allowed to activate plugins for this site.'));
if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) { if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) {
wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") ); wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
@ -69,7 +69,7 @@ if ( $action ) {
case 'activate-selected': case 'activate-selected':
if ( ! current_user_can('activate_plugins') ) if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); wp_die(__('Sorry, you are not allowed to activate plugins for this site.'));
check_admin_referer('bulk-plugins'); check_admin_referer('bulk-plugins');
@ -147,7 +147,7 @@ if ( $action ) {
case 'error_scrape': case 'error_scrape':
if ( ! current_user_can('activate_plugins') ) if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); wp_die(__('Sorry, you are not allowed to activate plugins for this site.'));
check_admin_referer('plugin-activation-error_' . $plugin); check_admin_referer('plugin-activation-error_' . $plugin);
@ -168,7 +168,7 @@ if ( $action ) {
case 'deactivate': case 'deactivate':
if ( ! current_user_can('activate_plugins') ) if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.')); wp_die(__('Sorry, you are not allowed to deactivate plugins for this site.'));
check_admin_referer('deactivate-plugin_' . $plugin); check_admin_referer('deactivate-plugin_' . $plugin);
@ -193,7 +193,7 @@ if ( $action ) {
case 'deactivate-selected': case 'deactivate-selected':
if ( ! current_user_can('activate_plugins') ) if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.')); wp_die(__('Sorry, you are not allowed to deactivate plugins for this site.'));
check_admin_referer('bulk-plugins'); check_admin_referer('bulk-plugins');
@ -228,7 +228,7 @@ if ( $action ) {
case 'delete-selected': case 'delete-selected':
if ( ! current_user_can('delete_plugins') ) { if ( ! current_user_can('delete_plugins') ) {
wp_die(__('You do not have sufficient permissions to delete plugins for this site.')); wp_die(__('Sorry, you are not allowed to delete plugins for this site.'));
} }
check_admin_referer('bulk-plugins'); check_admin_referer('bulk-plugins');

View File

@ -57,7 +57,7 @@ $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( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to create posts as this user.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '</p>',
403 403
); );
} }

View File

@ -110,11 +110,11 @@ case 'edit':
wp_die( __( 'Unknown post type.' ) ); wp_die( __( 'Unknown post type.' ) );
if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) { if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
wp_die( __( 'You are not allowed to edit posts in this post type.' ) ); wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
} }
if ( ! current_user_can( 'edit_post', $post_id ) ) if ( ! current_user_can( 'edit_post', $post_id ) )
wp_die( __( 'You are not allowed to edit this item.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this item.' ) );
if ( 'trash' == $post->post_status ) if ( 'trash' == $post->post_status )
wp_die( __( 'You can&#8217;t edit this item because it is in the Trash. Please restore it and try again.' ) ); wp_die( __( 'You can&#8217;t edit this item because it is in the Trash. Please restore it and try again.' ) );
@ -211,7 +211,7 @@ case 'trash':
wp_die( __( 'Unknown post type.' ) ); wp_die( __( 'Unknown post type.' ) );
if ( ! current_user_can( 'delete_post', $post_id ) ) if ( ! current_user_can( 'delete_post', $post_id ) )
wp_die( __( 'You are not allowed to move this item to the Trash.' ) ); wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
if ( $user_id = wp_check_post_lock( $post_id ) ) { if ( $user_id = wp_check_post_lock( $post_id ) ) {
$user = get_userdata( $user_id ); $user = get_userdata( $user_id );
@ -234,7 +234,7 @@ case 'untrash':
wp_die( __( 'Unknown post type.' ) ); wp_die( __( 'Unknown post type.' ) );
if ( ! current_user_can( 'delete_post', $post_id ) ) if ( ! current_user_can( 'delete_post', $post_id ) )
wp_die( __( 'You are not allowed to restore this item from the Trash.' ) ); wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
if ( ! wp_untrash_post( $post_id ) ) if ( ! wp_untrash_post( $post_id ) )
wp_die( __( 'Error in restoring from Trash.' ) ); wp_die( __( 'Error in restoring from Trash.' ) );
@ -252,7 +252,7 @@ case 'delete':
wp_die( __( 'Unknown post type.' ) ); wp_die( __( 'Unknown post type.' ) );
if ( ! current_user_can( 'delete_post', $post_id ) ) if ( ! current_user_can( 'delete_post', $post_id ) )
wp_die( __( 'You are not allowed to delete this item.' ) ); wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
if ( $post->post_type == 'attachment' ) { if ( $post->post_type == 'attachment' ) {
$force = ( ! MEDIA_TRASH ); $force = ( ! MEDIA_TRASH );

View File

@ -14,7 +14,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) { if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to create posts as this user.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '</p>',
403 403
); );
} }

View File

@ -35,7 +35,7 @@ if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ) ) ||
) { ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to manage this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to manage this item.' ) . '</p>',
403 403
); );
} }

View File

@ -15,7 +15,7 @@ if ( is_multisite() && ! is_network_admin() ) {
} }
if ( !current_user_can('edit_themes') ) if ( !current_user_can('edit_themes') )
wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site.').'</p>'); wp_die('<p>'.__('Sorry, you are not allowed to edit templates for this site.').'</p>');
$title = __("Edit Themes"); $title = __("Edit Themes");
$parent_file = 'themes.php'; $parent_file = 'themes.php';

View File

@ -13,7 +13,7 @@ require( ABSPATH . 'wp-admin/includes/theme-install.php' );
wp_reset_vars( array( 'tab' ) ); wp_reset_vars( array( 'tab' ) );
if ( ! current_user_can('install_themes') ) if ( ! current_user_can('install_themes') )
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
if ( is_multisite() && ! is_network_admin() ) { if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'theme-install.php' ) ); wp_redirect( network_admin_url( 'theme-install.php' ) );

View File

@ -12,7 +12,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) { if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
403 403
); );
} }
@ -40,7 +40,7 @@ if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
if ( ! current_user_can( 'delete_themes' ) ) { if ( ! current_user_can( 'delete_themes' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to delete this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
403 403
); );
} }

View File

@ -20,7 +20,7 @@ if ( is_multisite() && ! is_network_admin() ) {
} }
if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) ) if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) )
wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
/** /**
* *
@ -623,7 +623,7 @@ if ( 'upgrade-core' == $action ) {
} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
if ( ! current_user_can( 'update_core' ) ) if ( ! current_user_can( 'update_core' ) )
wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
check_admin_referer('upgrade-core'); check_admin_referer('upgrade-core');
@ -647,7 +647,7 @@ if ( 'upgrade-core' == $action ) {
} elseif ( 'do-plugin-upgrade' == $action ) { } elseif ( 'do-plugin-upgrade' == $action ) {
if ( ! current_user_can( 'update_plugins' ) ) if ( ! current_user_can( 'update_plugins' ) )
wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
check_admin_referer('upgrade-core'); check_admin_referer('upgrade-core');
@ -675,7 +675,7 @@ if ( 'upgrade-core' == $action ) {
} elseif ( 'do-theme-upgrade' == $action ) { } elseif ( 'do-theme-upgrade' == $action ) {
if ( ! current_user_can( 'update_themes' ) ) if ( ! current_user_can( 'update_themes' ) )
wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
check_admin_referer('upgrade-core'); check_admin_referer('upgrade-core');
@ -705,7 +705,7 @@ if ( 'upgrade-core' == $action ) {
} elseif ( 'do-translation-upgrade' == $action ) { } elseif ( 'do-translation-upgrade' == $action ) {
if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_plugins' ) && ! current_user_can( 'update_themes' ) ) if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_plugins' ) && ! current_user_can( 'update_themes' ) )
wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
check_admin_referer( 'upgrade-translations' ); check_admin_referer( 'upgrade-translations' );

View File

@ -21,7 +21,7 @@ if ( isset($_GET['action']) ) {
if ( 'update-selected' == $action ) { if ( 'update-selected' == $action ) {
if ( ! current_user_can( 'update_plugins' ) ) if ( ! current_user_can( 'update_plugins' ) )
wp_die( __( 'You do not have sufficient permissions to update plugins for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
check_admin_referer( 'bulk-update-plugins' ); check_admin_referer( 'bulk-update-plugins' );
@ -47,7 +47,7 @@ if ( isset($_GET['action']) ) {
} elseif ( 'upgrade-plugin' == $action ) { } elseif ( 'upgrade-plugin' == $action ) {
if ( ! current_user_can('update_plugins') ) if ( ! current_user_can('update_plugins') )
wp_die(__('You do not have sufficient permissions to update plugins for this site.')); wp_die(__('Sorry, you are not allowed to update plugins for this site.'));
check_admin_referer('upgrade-plugin_' . $plugin); check_admin_referer('upgrade-plugin_' . $plugin);
@ -68,7 +68,7 @@ if ( isset($_GET['action']) ) {
} elseif ('activate-plugin' == $action ) { } elseif ('activate-plugin' == $action ) {
if ( ! current_user_can('update_plugins') ) if ( ! current_user_can('update_plugins') )
wp_die(__('You do not have sufficient permissions to update plugins for this site.')); wp_die(__('Sorry, you are not allowed to update plugins for this site.'));
check_admin_referer('activate-plugin_' . $plugin); check_admin_referer('activate-plugin_' . $plugin);
if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) { if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) {
@ -93,7 +93,7 @@ if ( isset($_GET['action']) ) {
} elseif ( 'install-plugin' == $action ) { } elseif ( 'install-plugin' == $action ) {
if ( ! current_user_can('install_plugins') ) if ( ! current_user_can('install_plugins') )
wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) ); wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api.. include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
@ -141,7 +141,7 @@ if ( isset($_GET['action']) ) {
} elseif ( 'upload-plugin' == $action ) { } elseif ( 'upload-plugin' == $action ) {
if ( ! current_user_can( 'upload_plugins' ) ) { if ( ! current_user_can( 'upload_plugins' ) ) {
wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) ); wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
} }
check_admin_referer('plugin-upload'); check_admin_referer('plugin-upload');
@ -169,7 +169,7 @@ if ( isset($_GET['action']) ) {
} elseif ( 'upgrade-theme' == $action ) { } elseif ( 'upgrade-theme' == $action ) {
if ( ! current_user_can('update_themes') ) if ( ! current_user_can('update_themes') )
wp_die(__('You do not have sufficient permissions to update themes for this site.')); wp_die(__('Sorry, you are not allowed to update themes for this site.'));
check_admin_referer('upgrade-theme_' . $theme); check_admin_referer('upgrade-theme_' . $theme);
@ -190,7 +190,7 @@ if ( isset($_GET['action']) ) {
include(ABSPATH . 'wp-admin/admin-footer.php'); include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ( 'update-selected-themes' == $action ) { } elseif ( 'update-selected-themes' == $action ) {
if ( ! current_user_can( 'update_themes' ) ) if ( ! current_user_can( 'update_themes' ) )
wp_die( __( 'You do not have sufficient permissions to update themes for this site.' ) ); wp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) );
check_admin_referer( 'bulk-update-themes' ); check_admin_referer( 'bulk-update-themes' );
@ -216,7 +216,7 @@ if ( isset($_GET['action']) ) {
} elseif ( 'install-theme' == $action ) { } elseif ( 'install-theme' == $action ) {
if ( ! current_user_can('install_themes') ) if ( ! current_user_can('install_themes') )
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); //for themes_api.. include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); //for themes_api..
@ -246,7 +246,7 @@ if ( isset($_GET['action']) ) {
} elseif ( 'upload-theme' == $action ) { } elseif ( 'upload-theme' == $action ) {
if ( ! current_user_can( 'upload_themes' ) ) { if ( ! current_user_can( 'upload_themes' ) ) {
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
} }
check_admin_referer('theme-upload'); check_admin_referer('theme-upload');

View File

@ -10,7 +10,7 @@
require_once( dirname( __FILE__ ) . '/admin.php' ); require_once( dirname( __FILE__ ) . '/admin.php' );
if ( !current_user_can('upload_files') ) if ( !current_user_can('upload_files') )
wp_die( __( 'You do not have permission to upload files.' ) ); wp_die( __( 'Sorry, you are not allowed to upload files.' ) );
$mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid'; $mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';
$modes = array( 'grid', 'list' ); $modes = array( 'grid', 'list' );
@ -132,7 +132,7 @@ if ( $doaction ) {
break; break;
foreach ( (array) $post_ids as $post_id ) { foreach ( (array) $post_ids as $post_id ) {
if ( !current_user_can( 'delete_post', $post_id ) ) if ( !current_user_can( 'delete_post', $post_id ) )
wp_die( __( 'You are not allowed to move this item to the Trash.' ) ); wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
if ( !wp_trash_post( $post_id ) ) if ( !wp_trash_post( $post_id ) )
wp_die( __( 'Error in moving to Trash.' ) ); wp_die( __( 'Error in moving to Trash.' ) );
@ -144,7 +144,7 @@ if ( $doaction ) {
break; break;
foreach ( (array) $post_ids as $post_id ) { foreach ( (array) $post_ids as $post_id ) {
if ( !current_user_can( 'delete_post', $post_id ) ) if ( !current_user_can( 'delete_post', $post_id ) )
wp_die( __( 'You are not allowed to move this item out of the Trash.' ) ); wp_die( __( 'Sorry, you are not allowed to move this item out of the Trash.' ) );
if ( !wp_untrash_post( $post_id ) ) if ( !wp_untrash_post( $post_id ) )
wp_die( __( 'Error in restoring from Trash.' ) ); wp_die( __( 'Error in restoring from Trash.' ) );
@ -156,7 +156,7 @@ if ( $doaction ) {
break; break;
foreach ( (array) $post_ids as $post_id_del ) { foreach ( (array) $post_ids as $post_id_del ) {
if ( !current_user_can( 'delete_post', $post_id_del ) ) if ( !current_user_can( 'delete_post', $post_id_del ) )
wp_die( __( 'You are not allowed to delete this item.' ) ); wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
if ( !wp_delete_attachment( $post_id_del ) ) if ( !wp_delete_attachment( $post_id_del ) )
wp_die( __( 'Error in deleting.' ) ); wp_die( __( 'Error in deleting.' ) );

View File

@ -77,7 +77,7 @@ if ( is_multisite()
&& $user_id != $current_user->ID && $user_id != $current_user->ID
&& ! apply_filters( 'enable_edit_any_user_configuration', true ) && ! apply_filters( 'enable_edit_any_user_configuration', true )
) { ) {
wp_die( __( 'You do not have permission to edit this user.' ) ); wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
} }
// Execute confirmed email change. See send_confirmation_on_profile_email(). // Execute confirmed email change. See send_confirmation_on_profile_email().
@ -110,7 +110,7 @@ case 'update':
check_admin_referer('update-user_' . $user_id); check_admin_referer('update-user_' . $user_id);
if ( !current_user_can('edit_user', $user_id) ) if ( !current_user_can('edit_user', $user_id) )
wp_die(__('You do not have permission to edit this user.')); wp_die(__('Sorry, you are not allowed to edit this user.'));
if ( IS_PROFILE_PAGE ) { if ( IS_PROFILE_PAGE ) {
/** /**
@ -163,7 +163,7 @@ default:
$profileuser = get_user_to_edit($user_id); $profileuser = get_user_to_edit($user_id);
if ( !current_user_can('edit_user', $user_id) ) if ( !current_user_can('edit_user', $user_id) )
wp_die(__('You do not have permission to edit this user.')); wp_die(__('Sorry, you are not allowed to edit this user.'));
$sessions = WP_Session_Tokens::get_instance( $profileuser->ID ); $sessions = WP_Session_Tokens::get_instance( $profileuser->ID );

View File

@ -13,14 +13,14 @@ if ( is_multisite() ) {
if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) { if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You do not have sufficient permissions to add users to this network.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
403 403
); );
} }
} elseif ( ! current_user_can( 'create_users' ) ) { } elseif ( ! current_user_can( 'create_users' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to create users.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
403 403
); );
} }
@ -53,7 +53,7 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) {
if ( ! current_user_can( 'promote_user', $user_details->ID ) ) { if ( ! current_user_can( 'promote_user', $user_details->ID ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You do not have sufficient permissions to add users to this network.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
403 403
); );
} }
@ -107,7 +107,7 @@ Please click the following link to confirm the invite:
if ( ! current_user_can( 'create_users' ) ) { if ( ! current_user_can( 'create_users' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to create users.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
403 403
); );
} }

View File

@ -13,7 +13,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'list_users' ) ) { if ( ! current_user_can( 'list_users' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to browse users.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to browse users.' ) . '</p>',
403 403
); );
} }

View File

@ -15,7 +15,7 @@ require_once(ABSPATH . 'wp-admin/includes/widgets.php');
if ( ! current_user_can( 'edit_theme_options' ) ) { if ( ! current_user_can( 'edit_theme_options' ) ) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
403 403
); );
} }

View File

@ -387,7 +387,7 @@ final class WP_Customize_Manager {
show_admin_bar( false ); show_admin_bar( false );
if ( ! current_user_can( 'customize' ) ) { if ( ! current_user_can( 'customize' ) ) {
$this->wp_die( -1, __( 'You are not allowed to customize this site.' ) ); $this->wp_die( -1, __( 'Sorry, you are not allowed to customize this site.' ) );
} }
$this->original_stylesheet = get_stylesheet(); $this->original_stylesheet = get_stylesheet();
@ -401,7 +401,7 @@ final class WP_Customize_Manager {
// If the requested theme is not the active theme and the user doesn't have the // If the requested theme is not the active theme and the user doesn't have the
// switch_themes cap, bail. // switch_themes cap, bail.
if ( ! current_user_can( 'switch_themes' ) ) { if ( ! current_user_can( 'switch_themes' ) ) {
$this->wp_die( -1, __( 'You are not allowed to edit theme options on this site.' ) ); $this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) );
} }
// If the theme has errors while loading, bail. // If the theme has errors while loading, bail.

View File

@ -1340,7 +1340,7 @@ class wp_xmlrpc_server extends IXR_Server {
$post_data['post_author'] = absint( $post_data['post_author'] ); $post_data['post_author'] = absint( $post_data['post_author'] );
if ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) { if ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) {
if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) if ( ! current_user_can( $post_type->cap->edit_others_posts ) )
return new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) );
$author = get_userdata( $post_data['post_author'] ); $author = get_userdata( $post_data['post_author'] );
@ -1634,7 +1634,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
if ( ! current_user_can( 'delete_post', $post_id ) ) { if ( ! current_user_can( 'delete_post', $post_id ) ) {
return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete this post.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) );
} }
$result = wp_delete_post( $post_id ); $result = wp_delete_post( $post_id );
@ -1792,7 +1792,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
if ( ! current_user_can( $post_type->cap->edit_posts ) ) if ( ! current_user_can( $post_type->cap->edit_posts ) )
return new IXR_Error( 401, __( 'You are not allowed to edit posts in this post type.' )); return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ));
$query['post_type'] = $post_type->name; $query['post_type'] = $post_type->name;
@ -1875,7 +1875,7 @@ class wp_xmlrpc_server extends IXR_Server {
$taxonomy = get_taxonomy( $content_struct['taxonomy'] ); $taxonomy = get_taxonomy( $content_struct['taxonomy'] );
if ( ! current_user_can( $taxonomy->cap->manage_terms ) ) if ( ! current_user_can( $taxonomy->cap->manage_terms ) )
return new IXR_Error( 401, __( 'You are not allowed to create terms in this taxonomy.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) );
$taxonomy = (array) $taxonomy; $taxonomy = (array) $taxonomy;
@ -1962,7 +1962,7 @@ class wp_xmlrpc_server extends IXR_Server {
$taxonomy = get_taxonomy( $content_struct['taxonomy'] ); $taxonomy = get_taxonomy( $content_struct['taxonomy'] );
if ( ! current_user_can( $taxonomy->cap->edit_terms ) ) if ( ! current_user_can( $taxonomy->cap->edit_terms ) )
return new IXR_Error( 401, __( 'You are not allowed to edit terms in this taxonomy.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) );
$taxonomy = (array) $taxonomy; $taxonomy = (array) $taxonomy;
@ -2058,7 +2058,7 @@ class wp_xmlrpc_server extends IXR_Server {
$taxonomy = get_taxonomy( $taxonomy ); $taxonomy = get_taxonomy( $taxonomy );
if ( ! current_user_can( $taxonomy->cap->delete_terms ) ) if ( ! current_user_can( $taxonomy->cap->delete_terms ) )
return new IXR_Error( 401, __( 'You are not allowed to delete terms in this taxonomy.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete terms in this taxonomy.' ) );
$term = get_term( $term_id, $taxonomy->name ); $term = get_term( $term_id, $taxonomy->name );
@ -2129,7 +2129,7 @@ class wp_xmlrpc_server extends IXR_Server {
$taxonomy = get_taxonomy( $taxonomy ); $taxonomy = get_taxonomy( $taxonomy );
if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) if ( ! current_user_can( $taxonomy->cap->assign_terms ) )
return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) );
$term = get_term( $term_id , $taxonomy->name, ARRAY_A ); $term = get_term( $term_id , $taxonomy->name, ARRAY_A );
@ -2187,7 +2187,7 @@ class wp_xmlrpc_server extends IXR_Server {
$taxonomy = get_taxonomy( $taxonomy ); $taxonomy = get_taxonomy( $taxonomy );
if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) if ( ! current_user_can( $taxonomy->cap->assign_terms ) )
return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) );
$query = array(); $query = array();
@ -2282,7 +2282,7 @@ class wp_xmlrpc_server extends IXR_Server {
$taxonomy = get_taxonomy( $taxonomy ); $taxonomy = get_taxonomy( $taxonomy );
if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) if ( ! current_user_can( $taxonomy->cap->assign_terms ) )
return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) );
return $this->_prepare_taxonomy( $taxonomy, $fields ); return $this->_prepare_taxonomy( $taxonomy, $fields );
} }
@ -2470,7 +2470,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.getUsers' ); do_action( 'xmlrpc_call', 'wp.getUsers' );
if ( ! current_user_can( 'list_users' ) ) if ( ! current_user_can( 'list_users' ) )
return new IXR_Error( 401, __( 'You are not allowed to browse users.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to browse users.' ) );
$query = array( 'fields' => 'all_with_meta' ); $query = array( 'fields' => 'all_with_meta' );
@ -2794,7 +2794,7 @@ class wp_xmlrpc_server extends IXR_Server {
// Make sure the user can delete pages. // Make sure the user can delete pages.
if ( !current_user_can('delete_page', $page_id) ) if ( !current_user_can('delete_page', $page_id) )
return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete this page.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this page.' ) );
// Attempt to delete the page. // Attempt to delete the page.
$result = wp_delete_post($page_id); $result = wp_delete_post($page_id);
@ -2856,7 +2856,7 @@ class wp_xmlrpc_server extends IXR_Server {
// Make sure the user is allowed to edit pages. // Make sure the user is allowed to edit pages.
if ( !current_user_can('edit_page', $page_id) ) if ( !current_user_can('edit_page', $page_id) )
return new IXR_Error( 401, __( 'Sorry, you do not have the right to edit this page.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) );
// Mark this as content for a page. // Mark this as content for a page.
$content['post_type'] = 'page'; $content['post_type'] = 'page';
@ -3053,7 +3053,7 @@ class wp_xmlrpc_server extends IXR_Server {
// Make sure the user is allowed to add a category. // Make sure the user is allowed to add a category.
if ( !current_user_can('manage_categories') ) if ( !current_user_can('manage_categories') )
return new IXR_Error(401, __('Sorry, you do not have the right to add a category.')); return new IXR_Error(401, __('Sorry, you are not allowed to add a category.'));
// If no slug was provided make it empty so that // If no slug was provided make it empty so that
// WordPress will generate one. // WordPress will generate one.
@ -3128,7 +3128,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.deleteCategory' ); do_action( 'xmlrpc_call', 'wp.deleteCategory' );
if ( !current_user_can('manage_categories') ) if ( !current_user_can('manage_categories') )
return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete a category.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete a category.' ) );
$status = wp_delete_term( $category_id, 'category' ); $status = wp_delete_term( $category_id, 'category' );
@ -3226,7 +3226,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
if ( ! current_user_can( 'edit_comment', $comment_id ) ) { if ( ! current_user_can( 'edit_comment', $comment_id ) ) {
return new IXR_Error( 403, __( 'You are not allowed to moderate or edit this comment.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) );
} }
return $this->_prepare_comment( $comment ); return $this->_prepare_comment( $comment );
@ -3358,7 +3358,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
if ( !current_user_can( 'edit_comment', $comment_ID ) ) { if ( !current_user_can( 'edit_comment', $comment_ID ) ) {
return new IXR_Error( 403, __( 'You are not allowed to moderate or edit this comment.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) );
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
@ -3425,7 +3425,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
if ( ! current_user_can( 'edit_comment', $comment_ID ) ) { if ( ! current_user_can( 'edit_comment', $comment_ID ) ) {
return new IXR_Error( 403, __( 'You are not allowed to moderate or edit this comment.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) );
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
@ -3629,7 +3629,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
if ( ! current_user_can( 'publish_posts' ) ) { if ( ! current_user_can( 'publish_posts' ) ) {
return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
@ -3670,7 +3670,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
if ( ! current_user_can( 'edit_post', $post_id ) ) { if ( ! current_user_can( 'edit_post', $post_id ) ) {
return new IXR_Error( 403, __( 'You are not allowed access to details of this post.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details of this post.' ) );
} }
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
@ -3710,7 +3710,7 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
if ( !current_user_can( 'edit_posts' ) ) if ( !current_user_can( 'edit_posts' ) )
return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPostStatusList' ); do_action( 'xmlrpc_call', 'wp.getPostStatusList' );
@ -3742,7 +3742,7 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
if ( !current_user_can( 'edit_pages' ) ) if ( !current_user_can( 'edit_pages' ) )
return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPageStatusList' ); do_action( 'xmlrpc_call', 'wp.getPageStatusList' );
@ -3774,7 +3774,7 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
if ( !current_user_can( 'edit_pages' ) ) if ( !current_user_can( 'edit_pages' ) )
return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
$templates = get_page_templates(); $templates = get_page_templates();
$templates['Default'] = 'default'; $templates['Default'] = 'default';
@ -3868,7 +3868,7 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
if ( !current_user_can( 'manage_options' ) ) if ( !current_user_can( 'manage_options' ) )
return new IXR_Error( 403, __( 'You are not allowed to update options.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed to update options.' ) );
$option_names = array(); $option_names = array();
foreach ( $options as $o_name => $o_value ) { foreach ( $options as $o_name => $o_value ) {
@ -3920,7 +3920,7 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
if ( !current_user_can( 'upload_files' ) ) if ( !current_user_can( 'upload_files' ) )
return new IXR_Error( 403, __( 'You do not have permission to upload files.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed to upload files.' ) );
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getMediaItem' ); do_action( 'xmlrpc_call', 'wp.getMediaItem' );
@ -3968,7 +3968,7 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
if ( !current_user_can( 'upload_files' ) ) if ( !current_user_can( 'upload_files' ) )
return new IXR_Error( 401, __( 'You do not have permission to upload files.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) );
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getMediaLibrary' ); do_action( 'xmlrpc_call', 'wp.getMediaLibrary' );
@ -4012,7 +4012,7 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
if ( !current_user_can( 'edit_posts' ) ) if ( !current_user_can( 'edit_posts' ) )
return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) );
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPostFormats' ); do_action( 'xmlrpc_call', 'wp.getPostFormats' );
@ -4682,10 +4682,10 @@ class wp_xmlrpc_server extends IXR_Server {
$this->escape($actual_post); $this->escape($actual_post);
if ( ! current_user_can( 'edit_post', $post_ID ) ) { if ( ! current_user_can( 'edit_post', $post_ID ) ) {
return new IXR_Error(401, __('Sorry, you do not have the right to edit this post.')); return new IXR_Error(401, __('Sorry, you are not allowed to edit this post.'));
} }
if ( 'publish' == $actual_post['post_status'] && ! current_user_can( 'publish_posts' ) ) { if ( 'publish' == $actual_post['post_status'] && ! current_user_can( 'publish_posts' ) ) {
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) );
} }
$postdata = array(); $postdata = array();
@ -4752,7 +4752,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
if ( ! current_user_can( 'delete_post', $post_ID ) ) { if ( ! current_user_can( 'delete_post', $post_ID ) ) {
return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete this post.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) );
} }
$result = wp_delete_post( $post_ID ); $result = wp_delete_post( $post_ID );
@ -4905,11 +4905,11 @@ class wp_xmlrpc_server extends IXR_Server {
switch ( $post_type ) { switch ( $post_type ) {
case "post": case "post":
if ( !current_user_can( 'edit_others_posts' ) ) if ( !current_user_can( 'edit_others_posts' ) )
return new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) );
break; break;
case "page": case "page":
if ( !current_user_can( 'edit_others_pages' ) ) if ( !current_user_can( 'edit_others_pages' ) )
return new IXR_Error( 401, __( 'You are not allowed to create pages as this user.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to create pages as this user.' ) );
break; break;
default: default:
return new IXR_Error( 401, __( 'Invalid post type' ) ); return new IXR_Error( 401, __( 'Invalid post type' ) );
@ -5186,7 +5186,7 @@ class wp_xmlrpc_server extends IXR_Server {
return new IXR_Error( 404, __( 'Invalid post ID.' ) ); return new IXR_Error( 404, __( 'Invalid post ID.' ) );
if ( ! current_user_can( 'edit_post', $post_ID ) ) if ( ! current_user_can( 'edit_post', $post_ID ) )
return new IXR_Error( 401, __( 'Sorry, you do not have the right to edit this post.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
// Use wp.editPost to edit post types other than post and page. // Use wp.editPost to edit post types other than post and page.
if ( ! in_array( $postdata[ 'post_type' ], array( 'post', 'page' ) ) ) if ( ! in_array( $postdata[ 'post_type' ], array( 'post', 'page' ) ) )
@ -5245,12 +5245,12 @@ class wp_xmlrpc_server extends IXR_Server {
switch ( $post_type ) { switch ( $post_type ) {
case 'post': case 'post':
if ( ! current_user_can( 'edit_others_posts' ) ) { if ( ! current_user_can( 'edit_others_posts' ) ) {
return new IXR_Error( 401, __( 'You are not allowed to change the post author as this user.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to change the post author as this user.' ) );
} }
break; break;
case 'page': case 'page':
if ( ! current_user_can( 'edit_others_pages' ) ) { if ( ! current_user_can( 'edit_others_pages' ) ) {
return new IXR_Error( 401, __( 'You are not allowed to change the page author as this user.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to change the page author as this user.' ) );
} }
break; break;
default: default:
@ -5357,9 +5357,9 @@ class wp_xmlrpc_server extends IXR_Server {
if ( 'publish' == $post_status || 'private' == $post_status ) { if ( 'publish' == $post_status || 'private' == $post_status ) {
if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) { if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) {
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this page.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this page.' ) );
} elseif ( ! current_user_can( 'publish_posts' ) ) { } elseif ( ! current_user_can( 'publish_posts' ) ) {
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) );
} }
} }
@ -5790,7 +5790,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'metaWeblog.newMediaObject' ); do_action( 'xmlrpc_call', 'metaWeblog.newMediaObject' );
if ( !current_user_can('upload_files') ) { if ( !current_user_can('upload_files') ) {
$this->error = new IXR_Error( 401, __( 'You do not have permission to upload files.' ) ); $this->error = new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) );
return $this->error; return $this->error;
} }

View File

@ -545,7 +545,7 @@ function _show_post_preview() {
$id = (int) $_GET['preview_id']; $id = (int) $_GET['preview_id'];
if ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) ) if ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) )
wp_die( __('You do not have permission to preview drafts.') ); wp_die( __('Sorry, you are not allowed to preview drafts.') );
add_filter('the_preview', '_set_preview'); add_filter('the_preview', '_set_preview');
} }

View File

@ -124,7 +124,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), false, 1 ); $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), false, 1 );
did_action( 'init' ) && $scripts->localize( 'wp-ajax-response', 'wpAjax', array( did_action( 'init' ) && $scripts->localize( 'wp-ajax-response', 'wpAjax', array(
'noPerm' => __('You do not have permission to do that.'), 'noPerm' => __('Sorry, you are not allowed to do that.'),
'broken' => __('An unidentified error has occurred.') 'broken' => __('An unidentified error has occurred.')
) ); ) );
@ -445,7 +445,7 @@ function wp_default_scripts( &$scripts ) {
'cancel' => __( 'Cancel' ), 'cancel' => __( 'Cancel' ),
'close' => __( 'Close' ), 'close' => __( 'Close' ),
'cheatin' => __( 'Cheatin&#8217; uh?' ), 'cheatin' => __( 'Cheatin&#8217; uh?' ),
'notAllowed' => __( 'You are not allowed to customize this site.' ), 'notAllowed' => __( 'Sorry, you are not allowed to customize this site.' ),
'previewIframeTitle' => __( 'Site Preview' ), 'previewIframeTitle' => __( 'Site Preview' ),
'loginIframeTitle' => __( 'Session expired' ), 'loginIframeTitle' => __( 'Session expired' ),
'collapseSidebar' => __( 'Collapse Sidebar' ), 'collapseSidebar' => __( 'Collapse Sidebar' ),
@ -485,7 +485,7 @@ function wp_default_scripts( &$scripts ) {
if ( is_admin() ) { if ( is_admin() ) {
$scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response' ), false, 1 ); $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array( did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array(
'noPerm' => __('You do not have permission to do that.'), 'noPerm' => __('Sorry, you are not allowed to do that.'),
'broken' => __('An unidentified error has occurred.') 'broken' => __('An unidentified error has occurred.')
)); ));

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.6-alpha-37913'; $wp_version = '4.6-alpha-37914';
/** /**
* 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.