diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 833a617bc7..3bcc14efc1 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -1993,11 +1993,11 @@ function wp_welcome_panel() { $customize_url = null; $can_edit_theme_options = current_user_can( 'edit_theme_options' ); $can_customize = current_user_can( 'customize' ); - $is_block_based_theme = wp_is_block_template_theme(); + $is_block_theme = wp_is_block_theme(); - if ( $is_block_based_theme && $can_edit_theme_options ) { + if ( $is_block_theme && $can_edit_theme_options ) { $customize_url = esc_url( admin_url( 'site-editor.php' ) ); - } elseif ( ! $is_block_based_theme && $can_customize ) { + } elseif ( ! $is_block_theme && $can_customize ) { $customize_url = wp_customize_url(); } ?> @@ -2012,7 +2012,7 @@ function wp_welcome_panel() {
true ) ) ) > 1 ) ) : ?> - +
diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 611c4e570b..fa2017a501 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -417,7 +417,7 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) { */ function wp_admin_bar_edit_site_menu( $wp_admin_bar ) { // Don't show if a block theme is not activated. - if ( ! wp_is_block_template_theme() ) { + if ( ! wp_is_block_theme() ) { return; } @@ -447,7 +447,7 @@ function wp_admin_bar_customize_menu( $wp_admin_bar ) { global $wp_customize; // Don't show if a block theme is activated. - if ( wp_is_block_template_theme() ) { + if ( wp_is_block_theme() ) { return; } diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 37b524fdc9..b5ac408278 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -1467,7 +1467,7 @@ final class WP_Theme implements ArrayAccess { * * @return bool */ - public function is_block_based() { + public function is_block_theme() { $paths_to_index_block_template = array( $this->get_file_path( '/block-templates/index.html' ), $this->get_file_path( '/templates/index.html' ), diff --git a/wp-includes/post.php b/wp-includes/post.php index f7fe8d7451..3091eeb9b8 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -356,7 +356,7 @@ function create_initial_post_types() { 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'has_archive' => false, - 'show_ui' => wp_is_block_template_theme(), + 'show_ui' => wp_is_block_theme(), 'show_in_menu' => false, 'show_in_rest' => true, 'rewrite' => false, @@ -416,7 +416,7 @@ function create_initial_post_types() { 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'has_archive' => false, - 'show_ui' => wp_is_block_template_theme(), + 'show_ui' => wp_is_block_theme(), 'show_in_menu' => false, 'show_in_rest' => true, 'rewrite' => false, @@ -503,7 +503,7 @@ function create_initial_post_types() { 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'has_archive' => false, - 'show_ui' => wp_is_block_template_theme(), + 'show_ui' => wp_is_block_theme(), 'show_in_menu' => 'themes.php', 'show_in_admin_bar' => false, 'show_in_rest' => true, diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 9737fb3cb5..c1f94428fe 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -4090,7 +4090,6 @@ function create_initial_theme_features() { * * @return boolean Whether the current theme is a block-based theme or not. */ -function wp_is_block_template_theme() { - return is_readable( get_theme_file_path( '/block-templates/index.html' ) ) || - is_readable( get_theme_file_path( '/templates/index.html' ) ); +function wp_is_block_theme() { + return wp_get_theme()->is_block_theme(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index db79323ae4..c405692118 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-beta1-52329'; +$wp_version = '5.9-beta1-52330'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.