]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/post.php
Wordpress 4.6-scripts
[autoinstalls/wordpress.git] / wp-admin / post.php
index 5333b5f306bb4c653dea9b31bb80e169dd65ad35..437d1bd997e1ed32281f4898133085177111909a 100644 (file)
@@ -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