PluginProbe
Polylang / trunk
Polylang vtrunk
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | src/admin/admin-classic-editor.php +3 -9 3.8.8 → trunk View file →
@@ -189,15 +189,9 @@
189 189 }
190 190
191 191 Capabilities::get_user()->can_translate_or_die( $lang );
192 192
193 - $post_type_object = get_post_type_object( $post->post_type );
194 -
195 - if ( empty( $post_type_object ) ) {
196 - wp_die( esc_html( "{$post->post_type} is not a valid post type." ) );
197 - }
198 -
199 - if ( ! current_user_can( $post_type_object->cap->edit_post, $post->ID ) ) {
193 + if ( ! current_user_can( 'edit_post', $post->ID ) ) {
200 194 wp_die( 'You are not allowed to edit this post.' );
201 195 }
202 196
203 197 $this->model->post->set_language( $post->ID, $lang );
@@ -270,9 +264,9 @@
270 264 $x->Add( array( 'what' => 'pages', 'data' => $data ) );
271 265 }
272 266
273 267 // Flag
274 - $x->Add( array( 'what' => 'flag', 'data' => empty( $lang->flag ) ? esc_html( $lang->slug ) : $lang->flag ) );
268 + $x->Add( array( 'what' => 'flag', 'data' => $lang->get_admin_flag( 'aria-hidden' ) ) );
275 269
276 270 // Sample permalink
277 271 $x->Add( array( 'what' => 'permalink', 'data' => get_sample_permalink_html( $post->ID ) ) );
278 272
@@ -332,9 +326,9 @@
332 326 );
333 327 }
334 328 }
335 329
336 - wp_die( wp_json_encode( $return ) );
330 + wp_die( wp_json_encode( $return ) ?: '[]' );
337 331 }
338 332
339 333 /**
340 334 * Filters the pages by language in the parent dropdown list in the page attributes metabox.