Make WordPress Core


Ignore:
Timestamp:
12/07/2021 12:00:45 AM (3 years ago)
Author:
hellofromTonya
Message:

Themes: Better names for WP_Theme::is_block_theme() and wp_is_block_theme() and make wp_is_block_theme() a wrapper.

This commit renames the following method and function to better represent block theme terminology:

  • WP_Theme::is_block_based() to WP_Theme::is_block_theme()
  • wp_is_block_template_theme() to wp_is_block_theme()

It also changes wp_is_block_theme() to be a helper wrapper (sugar syntax) for wp_get_theme()->is_block_theme();. Why? To ensure both the method and function behave the same, to help Gutenberg maintain WordPress cross-version compatibility, and to make it less cumbersome to port changes from Gutenberg to Core.

Follow-up to [52069], [52247], [52279].

Props antonvlasenko, costdev, hellofromTonya, noisysocks.
Fixes #54550.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r52275 r52330  
    357357            '_builtin'              => true, /* internal use only. don't use this when registering your own post type. */
    358358            'has_archive'           => false,
    359             'show_ui'               => wp_is_block_template_theme(),
     359            'show_ui'               => wp_is_block_theme(),
    360360            'show_in_menu'          => false,
    361361            'show_in_rest'          => true,
     
    417417            '_builtin'              => true, /* internal use only. don't use this when registering your own post type. */
    418418            'has_archive'           => false,
    419             'show_ui'               => wp_is_block_template_theme(),
     419            'show_ui'               => wp_is_block_theme(),
    420420            'show_in_menu'          => false,
    421421            'show_in_rest'          => true,
     
    504504            '_builtin'              => true, /* internal use only. don't use this when registering your own post type. */
    505505            'has_archive'           => false,
    506             'show_ui'               => wp_is_block_template_theme(),
     506            'show_ui'               => wp_is_block_theme(),
    507507            'show_in_menu'          => 'themes.php',
    508508            'show_in_admin_bar'     => false,
Note: See TracChangeset for help on using the changeset viewer.