X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/b925718b4bf2dd47a8429f844d0a255ca6e35bd1..b22765f41bf0b2021b9beb9120ee0ac91fa89292:/wp-admin/post.php diff --git a/wp-admin/post.php b/wp-admin/post.php index 5333b5f3..437d1bd9 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -110,11 +110,11 @@ case 'edit': wp_die( __( 'Unknown post type.' ) ); 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 ) ) - 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 ) wp_die( __( 'You can’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.' ) ); 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 ) ) { $user = get_userdata( $user_id ); @@ -234,7 +234,7 @@ case 'untrash': wp_die( __( 'Unknown post type.' ) ); 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 ) ) wp_die( __( 'Error in restoring from Trash.' ) ); @@ -252,7 +252,7 @@ case 'delete': wp_die( __( 'Unknown post type.' ) ); 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' ) { $force = ( ! MEDIA_TRASH ); @@ -275,6 +275,17 @@ case 'preview': exit(); default: + /** + * Fires for a given custom post action request. + * + * The dynamic portion of the hook name, `$action`, refers to the custom post action. + * + * @since 4.6.0 + * + * @param int $post_id Post ID sent with the request. + */ + do_action( "post_action_{$action}", $post_id ); + wp_redirect( admin_url('edit.php') ); exit(); } // end switch