On this page
wp_is_block_theme(): boolean
Returns whether the active theme is a block-based theme or not.
Return
boolean Whether the active theme is a block-based theme or not.
Source
File: wp-includes/theme.php. View all references
function wp_is_block_theme() {
return wp_get_theme()->is_block_theme();
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Theme::is_block_theme() wp-includes/class-wp-theme.php | Returns whether this theme is a block-based theme or not. |
| wp_get_theme() wp-includes/theme.php | Gets a WP_Theme object for a theme. |
Used By
| Used By | Description |
|---|---|
| wp_enqueue_stored_styles() wp-includes/script-loader.php | Fetches, processes and compiles stored core styles, then combines and renders them to the page. |
| wp_enqueue_block_support_styles() wp-includes/script-loader.php | Hooks inline styles in the proper place, depending on the active theme. |
| _add_default_theme_supports() wp-includes/theme.php | Adds default theme supports for block themes when the ‘setup_theme’ action fires. |
| wp_admin_bar_edit_site_menu() wp-includes/admin-bar.php | Adds the “Edit site” link to the Toolbar. |
| _add_plugin_file_editor_to_tools() wp-admin/menu.php | Adds the ‘Plugin File Editor’ menu item after the ‘Themes File Editor’ in Tools for block themes. |
| wp_enable_block_templates() wp-includes/theme-templates.php | Enables the block templates (editor mode) for themes with theme.json by default. |
| wp_enqueue_global_styles() wp-includes/script-loader.php | Enqueues the global styles defined via theme.json. |
| wp_admin_bar_customize_menu() wp-includes/admin-bar.php | Adds the “Customize” link to the Toolbar. |
| wp_welcome_panel() wp-admin/includes/dashboard.php | Displays a welcome panel to introduce users to WordPress. |
| _add_themes_utility_last() wp-admin/menu.php | Adds the ‘Theme File Editor’ menu item to the bottom of the Appearance (non-block themes) or Tools (block themes) menu. |
| wp_widgets_add_menu() wp-includes/functions.php | Appends the Widgets menu to the themes main menu. |
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_is_block_theme