From 74fa60b30af6dc05b944fbcaa66d0595f5ee8fef Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 19 Aug 2022 13:09:12 +0000 Subject: [PATCH] Themes: Include a hyphen in the Block Themes tab key on Add Themes screen. This better matches the tab name and changes the associated action hooks to: * `install_themes_pre_block-themes` (fires before the tab is rendered) * `install_themes_block-themes` (fires at the top the tab) While including a mix of underscores and hyphens in a hook name is not quite typical for core, it does have a precedent and brings more consistency with similar filters on Add Plugin screen: * `install_plugins_pre_plugin-information` * `install_plugins_plugin-information` Follow-up to [53906], [53907]. Fixes #56283. git-svn-id: https://develop.svn.wordpress.org/trunk@53908 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/wp/theme.js | 2 +- src/wp-admin/theme-install.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 1c0e12eed4..5daf04f7d7 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -1694,7 +1694,7 @@ themes.view.Installer = themes.view.Appearance.extend({ browse: function( section ) { // Create a new collection with the proper theme data // for each section. - if ( 'blockthemes' === section ) { + if ( 'block-themes' === section ) { // Get the themes by sending Ajax POST request to api.wordpress.org/themes // or searching the local cache. this.collection.query( { tag: 'full-site-editing' } ); diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 368ff9f898..668f856c50 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -90,7 +90,7 @@ if ( $tab ) { * * Possible hook names include: * - * - `install_themes_pre_blockthemes` + * - `install_themes_pre_block-themes` * - `install_themes_pre_dashboard` * - `install_themes_pre_featured` * - `install_themes_pre_new` @@ -99,7 +99,7 @@ if ( $tab ) { * - `install_themes_pre_upload` * * @since 2.8.0 - * @since 6.1.0 Added `install_themes_pre_blockthemes` hook name. + * @since 6.1.0 Added the `install_themes_pre_block-themes` hook name. */ do_action( "install_themes_pre_{$tab}" ); } @@ -187,7 +187,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; @@ -266,7 +266,7 @@ if ( $tab ) { * * Possible hook names include: * - * - `install_themes_blockthemes` + * - `install_themes_block-themes` * - `install_themes_dashboard` * - `install_themes_featured` * - `install_themes_new` @@ -275,7 +275,7 @@ if ( $tab ) { * - `install_themes_upload` * * @since 2.8.0 - * @since 6.1.0 Added `install_themes_blockthemes` hook name. + * @since 6.1.0 Added the `install_themes_block-themes` hook name. * * @param int $paged Number of the current page of results being viewed. */