rebase code on oct-10-2023
This commit is contained in:
@@ -219,11 +219,6 @@ class BlockTemplateUtils {
|
||||
$template->is_custom = false; // Templates loaded from the filesystem aren't custom, ones that have been edited and loaded from the DB are.
|
||||
$template->post_types = array(); // Don't appear in any Edit Post template selector dropdown.
|
||||
$template->area = 'uncategorized';
|
||||
|
||||
// Force the Mini-Cart template part to be in the Mini-Cart template part area.
|
||||
if ( 'wp_template_part' === $template_type && 'mini-cart' === $template_file->slug ) {
|
||||
$template->area = 'mini-cart';
|
||||
}
|
||||
return $template;
|
||||
}
|
||||
|
||||
@@ -445,25 +440,25 @@ class BlockTemplateUtils {
|
||||
/**
|
||||
* Checks to see if they are using a compatible version of WP, or if not they have a compatible version of the Gutenberg plugin installed.
|
||||
*
|
||||
* @param string $template_type Optional. Template type: `wp_template` or `wp_template_part`.
|
||||
* Default `wp_template`.
|
||||
* @return boolean
|
||||
*/
|
||||
public static function supports_block_templates( $template_type = 'wp_template' ) {
|
||||
if ( 'wp_template_part' === $template_type && ( wc_current_theme_is_fse_theme() || current_theme_supports( 'block-template-parts' ) ) ) {
|
||||
return true;
|
||||
} elseif ( 'wp_template' === $template_type && wc_current_theme_is_fse_theme() ) {
|
||||
return true;
|
||||
public static function supports_block_templates() {
|
||||
if (
|
||||
! wc_current_theme_is_fse_theme() &&
|
||||
( ! function_exists( 'gutenberg_supports_block_templates' ) || ! gutenberg_supports_block_templates() )
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a single unified template object using its id.
|
||||
*
|
||||
* @param string $id Template unique identifier (example: theme_slug//template_slug).
|
||||
* @param string $template_type Optional. Template type: `wp_template` or 'wp_template_part`.
|
||||
* Default `wp_template`.
|
||||
* @param string $template_type Optional. Template type: `'wp_template'` or '`wp_template_part'`.
|
||||
* Default `'wp_template'`.
|
||||
*
|
||||
* @return WP_Block_Template|null Template.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user