Ticket #46195: 46195.6.diff
File 46195.6.diff, 3.0 KB (added by , 6 years ago) |
---|
-
src/wp-admin/edit-form-advanced.php
18 18 */ 19 19 global $post_type, $post_type_object, $post; 20 20 21 // Flag that we're not loading the block editor. 22 $current_screen = get_current_screen(); 23 $current_screen->is_block_editor( false ); 24 21 25 if ( is_multisite() ) { 22 26 add_action( 'admin_footer', '_admin_notice_post_locked' ); 23 27 } else { -
src/wp-admin/includes/class-wp-screen.php
202 202 return $hook_name; 203 203 } 204 204 205 $post_type = $taxonomy = null; 206 $in_admin = false; 207 $action = ''; 205 $post_type = $taxonomy = null; 206 $in_admin = false; 207 $action = ''; 208 $is_block_editor = false; 208 209 209 210 if ( $hook_name ) { 210 211 $id = $hook_name; … … 294 295 $post = get_post( $post_id ); 295 296 if ( $post ) { 296 297 $post_type = $post->post_type; 298 299 $replace_editor = apply_filters( 'replace_editor', false, $post ); 300 301 if ( ! $replace_editor ) { 302 $is_block_editor = use_block_editor_for_post( $post ); 303 } 297 304 } 298 305 } 299 306 break; … … 314 321 if ( null === $post_type ) { 315 322 $post_type = 'post'; 316 323 } 324 325 // When creating a new post, use the default block editor support value for the post type. 326 if ( empty( $post_id ) ) { 327 $is_block_editor = use_block_editor_for_post_type( $post_type ); 328 } 329 317 330 $id = $post_type; 318 331 break; 319 332 case 'edit': … … 357 370 $screen->id = $id; 358 371 } 359 372 360 $screen->base = $base; 361 $screen->action = $action; 362 $screen->post_type = (string) $post_type; 363 $screen->taxonomy = (string) $taxonomy; 364 $screen->is_user = ( 'user' == $in_admin ); 365 $screen->is_network = ( 'network' == $in_admin ); 366 $screen->in_admin = $in_admin; 373 $screen->base = $base; 374 $screen->action = $action; 375 $screen->post_type = (string) $post_type; 376 $screen->taxonomy = (string) $taxonomy; 377 $screen->is_user = ( 'user' == $in_admin ); 378 $screen->is_network = ( 'network' == $in_admin ); 379 $screen->in_admin = $in_admin; 380 $screen->is_block_editor = $is_block_editor; 367 381 368 382 self::$_registry[ $id ] = $screen; 369 383 -
src/wp-admin/post-new.php
74 74 wp_enqueue_script( 'autosave' ); 75 75 include( ABSPATH . 'wp-admin/edit-form-advanced.php' ); 76 76 } 77 } else { 78 // Flag that we're not loading the block editor. 79 $current_screen = get_current_screen(); 80 $current_screen->is_block_editor( false ); 77 81 } 78 82 79 83 include( ABSPATH . 'wp-admin/admin-footer.php' );