Skip to content

Commit ed79860

Browse files
Rename WP_Theme::is_block_based to wp_is_block_theme.
See https://core.trac.wordpress.org/ticket/54552
1 parent 450c03d commit ed79860

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/wp-admin/includes/dashboard.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,11 +1993,11 @@ function wp_welcome_panel() {
19931993
$customize_url = null;
19941994
$can_edit_theme_options = current_user_can( 'edit_theme_options' );
19951995
$can_customize = current_user_can( 'customize' );
1996-
$is_block_based_theme = wp_is_block_theme();
1996+
$is_block_theme = wp_is_block_theme();
19971997

1998-
if ( $is_block_based_theme && $can_edit_theme_options ) {
1998+
if ( $is_block_theme && $can_edit_theme_options ) {
19991999
$customize_url = esc_url( admin_url( 'site-editor.php' ) );
2000-
} elseif ( ! $is_block_based_theme && $can_customize ) {
2000+
} elseif ( ! $is_block_theme && $can_customize ) {
20012001
$customize_url = wp_customize_url();
20022002
}
20032003
?>
@@ -2012,7 +2012,7 @@ function wp_welcome_panel() {
20122012
<?php endif; ?>
20132013
<a class="button button-primary button-hero hide-if-customize" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>"><?php _e( 'Customize Your Site' ); ?></a>
20142014
<?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?>
2015-
<?php $themes_link = $can_customize && ! $is_block_based_theme ? add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ) : admin_url( 'themes.php' ); ?>
2015+
<?php $themes_link = $can_customize && ! $is_block_theme ? add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ) : admin_url( 'themes.php' ); ?>
20162016
<p class="hide-if-no-customize">
20172017
<?php
20182018
/* translators: %s: URL to Themes panel in Customizer or Themes screen. */

src/wp-admin/includes/theme.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,11 @@ function wp_prepare_themes_for_js( $themes = null ) {
704704

705705
$can_edit_theme_options = current_user_can( 'edit_theme_options' );
706706
$can_customize = current_user_can( 'customize' );
707-
$is_block_based_theme = $theme->is_block_based();
707+
$is_block_theme = $theme->is_block_theme();
708708

709-
if ( $is_block_based_theme && $can_edit_theme_options ) {
709+
if ( $is_block_theme && $can_edit_theme_options ) {
710710
$customize_action = esc_url( admin_url( 'site-editor.php' ) );
711-
} elseif ( ! $is_block_based_theme && $can_customize && $can_edit_theme_options ) {
711+
} elseif ( ! $is_block_theme && $can_customize && $can_edit_theme_options ) {
712712
$customize_action = esc_url(
713713
add_query_arg(
714714
array(

src/wp-includes/class-wp-theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ public function is_allowed( $check = 'both', $blog_id = null ) {
14671467
*
14681468
* @return bool
14691469
*/
1470-
public function is_block_based() {
1470+
public function is_block_theme() {
14711471
$paths_to_index_block_template = array(
14721472
$this->get_file_path( '/block-templates/index.html' ),
14731473
$this->get_file_path( '/templates/index.html' ),

tests/phpunit/tests/theme/wpTheme.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,17 @@ public function test_network_disable_multiple_themes() {
248248
}
249249

250250
/**
251-
* @dataProvider data_is_block_based
251+
* @dataProvider data_is_block_theme
252252
* @ticket 54460
253253
*
254-
* @covers WP_Theme::is_block_based
254+
* @covers WP_Theme::is_block_theme
255255
*
256256
* @param string $theme_dir Directory of the theme to test.
257257
* @param bool $expected Expected result.
258258
*/
259-
public function test_is_block_based( $theme_dir, $expected ) {
259+
public function test_is_block_theme( $theme_dir, $expected ) {
260260
$theme = new WP_Theme( $theme_dir, $this->theme_root );
261-
$actual = $theme->is_block_based();
261+
$actual = $theme->is_block_theme();
262262

263263
if ( $expected ) {
264264
$this->assertTrue( $actual );
@@ -272,7 +272,7 @@ public function test_is_block_based( $theme_dir, $expected ) {
272272
*
273273
* @return array
274274
*/
275-
public function data_is_block_based() {
275+
public function data_is_block_theme() {
276276
return array(
277277
'default - non-block theme' => array(
278278
'theme_dir' => 'default',

0 commit comments

Comments
 (0)