equal
deleted
inserted
replaced
122 wp_redirect( admin_url( 'post.php' ) ); |
122 wp_redirect( admin_url( 'post.php' ) ); |
123 exit; |
123 exit; |
124 } |
124 } |
125 |
125 |
126 if ( ! $post ) { |
126 if ( ! $post ) { |
127 wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) ); |
127 wp_die( __( 'You attempted to edit an item that does not exist. Perhaps it was deleted?' ) ); |
128 } |
128 } |
129 |
129 |
130 if ( ! $post_type_object ) { |
130 if ( ! $post_type_object ) { |
131 wp_die( __( 'Invalid post type.' ) ); |
131 wp_die( __( 'Invalid post type.' ) ); |
132 } |
132 } |
138 if ( ! current_user_can( 'edit_post', $post_id ) ) { |
138 if ( ! current_user_can( 'edit_post', $post_id ) ) { |
139 wp_die( __( 'Sorry, you are not allowed to edit this item.' ) ); |
139 wp_die( __( 'Sorry, you are not allowed to edit this item.' ) ); |
140 } |
140 } |
141 |
141 |
142 if ( 'trash' === $post->post_status ) { |
142 if ( 'trash' === $post->post_status ) { |
143 wp_die( __( 'You can’t edit this item because it is in the Trash. Please restore it and try again.' ) ); |
143 wp_die( __( 'You cannot edit this item because it is in the Trash. Please restore it and try again.' ) ); |
144 } |
144 } |
145 |
145 |
146 if ( ! empty( $_GET['get-post-lock'] ) ) { |
146 if ( ! empty( $_GET['get-post-lock'] ) ) { |
147 check_admin_referer( 'lock-post_' . $post_id ); |
147 check_admin_referer( 'lock-post_' . $post_id ); |
148 wp_set_post_lock( $post_id ); |
148 wp_set_post_lock( $post_id ); |