~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-admin/post.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
                wp_die( __( 'Unknown post type.' ) );
111
111
 
112
112
        if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
113
 
                wp_die( __( 'You are not allowed to edit posts in this post type.' ) );
 
113
                wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
114
114
        }
115
115
 
116
116
        if ( ! current_user_can( 'edit_post', $post_id ) )
117
 
                wp_die( __( 'You are not allowed to edit this item.' ) );
 
117
                wp_die( __( 'Sorry, you are not allowed to edit this item.' ) );
118
118
 
119
119
        if ( 'trash' == $post->post_status )
120
120
                wp_die( __( 'You can’t edit this item because it is in the Trash. Please restore it and try again.' ) );
211
211
                wp_die( __( 'Unknown post type.' ) );
212
212
 
213
213
        if ( ! current_user_can( 'delete_post', $post_id ) )
214
 
                wp_die( __( 'You are not allowed to move this item to the Trash.' ) );
 
214
                wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
215
215
 
216
216
        if ( $user_id = wp_check_post_lock( $post_id ) ) {
217
217
                $user = get_userdata( $user_id );
234
234
                wp_die( __( 'Unknown post type.' ) );
235
235
 
236
236
        if ( ! current_user_can( 'delete_post', $post_id ) )
237
 
                wp_die( __( 'You are not allowed to restore this item from the Trash.' ) );
 
237
                wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
238
238
 
239
239
        if ( ! wp_untrash_post( $post_id ) )
240
240
                wp_die( __( 'Error in restoring from Trash.' ) );
252
252
                wp_die( __( 'Unknown post type.' ) );
253
253
 
254
254
        if ( ! current_user_can( 'delete_post', $post_id ) )
255
 
                wp_die( __( 'You are not allowed to delete this item.' ) );
 
255
                wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
256
256
 
257
257
        if ( $post->post_type == 'attachment' ) {
258
258
                $force = ( ! MEDIA_TRASH );
275
275
        exit();
276
276
 
277
277
default:
 
278
        /**
 
279
         * Fires for a given custom post action request.
 
280
         *
 
281
         * The dynamic portion of the hook name, `$action`, refers to the custom post action.
 
282
         *
 
283
         * @since 4.6.0
 
284
         *
 
285
         * @param int $post_id Post ID sent with the request.
 
286
         */
 
287
        do_action( "post_action_{$action}", $post_id );
 
288
 
278
289
        wp_redirect( admin_url('edit.php') );
279
290
        exit();
280
291
} // end switch