// Add additional back-compat patterns registered by `current_screen` et al.
$editor_settings['__experimentalAdditionalBlockPatterns'
] = WP_Block_Patterns_Registry::
get_instance()->
get_all_registered( true
);
$editor_settings['__experimentalAdditionalBlockPatternCategories'
] = WP_Block_Pattern_Categories_Registry::
get_instance()->
get_all_registered( true
);
$autosave =
wp_get_post_autosave( $post->ID
);
if ( $autosave ) { if ( mysql2date( 'U',
$autosave->post_modified_gmt, false
) >
mysql2date( 'U',
$post->post_modified_gmt, false
) ) { $editor_settings['autosave'
] = array
( 'editLink' =>
get_edit_post_link( $autosave->ID
),
);
} else { wp_delete_post_revision( $autosave->ID
);
}}if ( !
empty( $post_type_object->template
) ) { $editor_settings['template'
] =
$post_type_object->template;
$editor_settings['templateLock'
] = !
empty( $post_type_object->template_lock
) ?
$post_type_object->template_lock : false;
}// If there's no template set on a new post, use the post format, instead.
if ( $is_new_post && !
isset( $editor_settings['template'
] ) && 'post' ===
$post->post_type
) { $post_format =
get_post_format( $post );