From 70c397fe030370420afaaa9b43e592d3c6ffdaa8 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Feb 2026 10:20:02 +1100 Subject: [PATCH 01/15] Correct since annotation for block_core_page_list_get_submenu_visibility(). --- packages/block-library/src/page-list/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/page-list/index.php b/packages/block-library/src/page-list/index.php index 348381f32ecfb0..dc904fb42942f7 100644 --- a/packages/block-library/src/page-list/index.php +++ b/packages/block-library/src/page-list/index.php @@ -9,7 +9,7 @@ * Returns the submenu visibility value with backward compatibility * for the deprecated openSubmenusOnClick attribute. * - * @since 6.9.0 + * @since 7.0.0 * * @param array $context Block context from parent Navigation block. * @return string The visibility mode: 'hover', 'click', or 'always'. From 9fd62bcfffc27e7c5a400730c5c80c368bddf517 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Feb 2026 10:23:43 +1100 Subject: [PATCH 02/15] Correct since annotation for block_core_navigation_get_submenu_visibility() --- packages/block-library/src/navigation/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index dddfb74a426474..79a970681c6ed9 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -16,7 +16,7 @@ * will always have a value even for legacy blocks. We check the legacy openSubmenusOnClick * attribute first to preserve original behavior for blocks saved before the migration. * - * @since 6.9.0 + * @since 7.0.0 * * @param array $attributes Block attributes containing submenuVisibility and/or openSubmenusOnClick. * @return string The visibility mode: 'hover', 'click', or 'always'. From 14573214a4ee11996fc4cb726b11c2e7db10b11c Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Feb 2026 10:33:59 +1100 Subject: [PATCH 03/15] Soft deprecate block_core_navigation_link_render_submenu_icon(). --- .../block-library/src/navigation-link/index.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/block-library/src/navigation-link/index.php b/packages/block-library/src/navigation-link/index.php index 0888d7b5acebd8..bd94fa0cf2983d 100644 --- a/packages/block-library/src/navigation-link/index.php +++ b/packages/block-library/src/navigation-link/index.php @@ -123,6 +123,23 @@ function block_core_navigation_link_build_css_font_sizes( $context ) { return $font_sizes; } +/** + * Returns the top-level submenu SVG chevron icon. + * + * @since 5.9.0 + * @deprecated 7.0.0 Use block_core_navigation_render_submenu_icon() instead. + * + * @return string + */ +function block_core_navigation_link_render_submenu_icon() { + _deprecated_function( + __FUNCTION__, + '7.0.0', + 'block_core_navigation_render_submenu_icon' + ); + return block_core_navigation_render_submenu_icon(); +} + /** * Decodes a url if it's encoded, returning the same url if not. * From daeeaff216a7a8e011d828cfef27c8dc0bebfabc Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Feb 2026 11:21:15 +1100 Subject: [PATCH 04/15] Use WP_Styles API for inline styles. --- .../templates/page-wp-admin.php.template | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/wp-build/templates/page-wp-admin.php.template b/packages/wp-build/templates/page-wp-admin.php.template index 970954d34330af..4237044646e719 100644 --- a/packages/wp-build/templates/page-wp-admin.php.template +++ b/packages/wp-build/templates/page-wp-admin.php.template @@ -182,6 +182,10 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_enqueue_sc } ); wp_register_style( '{{PAGE_SLUG}}-wp-admin-prerequisites', false, $style_dependencies, $asset['version'] ); + wp_add_inline_style( + '{{PAGE_SLUG}}-wp-admin-prerequisites', + {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_inline_styles() + ); // Build dependencies for {{PAGE_SLUG}}-wp-admin module $boot_dependencies = array( @@ -230,7 +234,18 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_pag */ function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() { ?> - -
Date: Fri, 27 Feb 2026 11:47:50 +1100 Subject: [PATCH 05/15] Document the {{PAGE_SLUG}}-wp-admin_init actions. --- packages/wp-build/templates/page-wp-admin.php.template | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/wp-build/templates/page-wp-admin.php.template b/packages/wp-build/templates/page-wp-admin.php.template index 4237044646e719..97ec2ae6770df2 100644 --- a/packages/wp-build/templates/page-wp-admin.php.template +++ b/packages/wp-build/templates/page-wp-admin.php.template @@ -145,7 +145,9 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_enqueue_sc // Load build constants $build_constants = require __DIR__ . '/../../constants.php'; - // Fire init action for extensions to register routes and menu items + /** + * Fires as the {{PAGE_SLUG}} screen is initialized. + */ do_action( '{{PAGE_SLUG}}-wp-admin_init' ); // Preload REST API data From 8c92fd18ed98ea385652ac01ca23a24fd87a0eb4 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Feb 2026 11:54:06 +1100 Subject: [PATCH 06/15] Pass hook suffix to admin_footer action. --- packages/wp-build/templates/page.php.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wp-build/templates/page.php.template b/packages/wp-build/templates/page.php.template index af675f7f2e101a..574acaa977427c 100644 --- a/packages/wp-build/templates/page.php.template +++ b/packages/wp-build/templates/page.php.template @@ -289,7 +289,7 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_render_page' ) ) { * * @since 1.2.0 */ - do_action( 'admin_footer', '' ); + do_action( 'admin_footer', $hook_suffix ); // Print import map first so it's available for inline scripts wp_script_modules()->print_import_map(); From acf006bf4bd3f6691effd19bb717a1197a0b5680 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Feb 2026 11:54:49 +1100 Subject: [PATCH 07/15] Document {{PAGE_SLUG}}_init hook --- packages/wp-build/templates/page.php.template | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/wp-build/templates/page.php.template b/packages/wp-build/templates/page.php.template index 574acaa977427c..bbf4f77dd2b75d 100644 --- a/packages/wp-build/templates/page.php.template +++ b/packages/wp-build/templates/page.php.template @@ -145,7 +145,9 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_render_page' ) ) { wp_dequeue_style( $style ); } - // Fire init action for extensions to register routes and menu items + /** + * Fire init action for extensions to register routes and menu items. + */ do_action( '{{PAGE_SLUG}}_init' ); // Enqueue command palette assets for boot-based pages From 9ae2dadcd0e736baa6c7cc8923007cba18f06191 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Feb 2026 11:55:04 +1100 Subject: [PATCH 08/15] Remove duplicate documentation for actions. --- packages/wp-build/templates/page.php.template | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/packages/wp-build/templates/page.php.template b/packages/wp-build/templates/page.php.template index bbf4f77dd2b75d..abf95d4548995a 100644 --- a/packages/wp-build/templates/page.php.template +++ b/packages/wp-build/templates/page.php.template @@ -265,18 +265,10 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_render_page' ) ) { print_admin_styles(); print_head_scripts(); - /** - * Fires in head section for a specific admin page. - * - * @since 2.1.0 - */ + /** This action is documented in wp-admin/admin-header.php */ do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores - /** - * Fires in head section for all admin pages. - * - * @since 2.1.0 - */ + /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_head' ); // END see wp-admin/admin-header.php ?> @@ -286,11 +278,7 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_render_page' ) ) { print_script_module_preloads(); wp_script_modules()->print_script_module_data(); - /** - * Prints scripts or data after the default footer scripts. - * - * @since 2.8.0 - */ + /** This action is documented in wp-admin/admin-footer.php */ do_action( "admin_footer-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores // END see wp-admin/admin-footer.php ?> From 3839d855f295991481a6f8b4fa34429600320b2b Mon Sep 17 00:00:00 2001 From: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> Date: Mon, 2 Mar 2026 07:43:52 +1100 Subject: [PATCH 09/15] =?UTF-8?q?Update=20CSS=20comments=20so=20they=20are?= =?UTF-8?q?=20actually=20comments=20=F0=9F=A4=A6=E2=80=8D=E2=99=82?= =?UTF-8?q?=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Weston Ruter --- packages/wp-build/templates/page-wp-admin.php.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wp-build/templates/page-wp-admin.php.template b/packages/wp-build/templates/page-wp-admin.php.template index 97ec2ae6770df2..9cad2f27cd79c1 100644 --- a/packages/wp-build/templates/page-wp-admin.php.template +++ b/packages/wp-build/templates/page-wp-admin.php.template @@ -301,7 +301,7 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_inline_sty } Date: Mon, 2 Mar 2026 11:39:13 +1100 Subject: [PATCH 10/15] Apply suggestions from code review Co-authored-by: Weston Ruter --- packages/wp-build/templates/page-wp-admin.php.template | 2 +- packages/wp-build/templates/page.php.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/wp-build/templates/page-wp-admin.php.template b/packages/wp-build/templates/page-wp-admin.php.template index 9cad2f27cd79c1..7ff2eef9d29a85 100644 --- a/packages/wp-build/templates/page-wp-admin.php.template +++ b/packages/wp-build/templates/page-wp-admin.php.template @@ -300,7 +300,7 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_inline_sty } } Date: Sun, 31 May 2026 20:29:30 +0900 Subject: [PATCH 11/15] Navigation Link: Soft deprecate block_core_navigation_link_build_css_font_sizes() trunk removed this long-standing public function (@since 5.9.0) when its logic moved to the shared helper block_core_shared_navigation_build_css_font_sizes(). Since this PR's goal is to preserve backward compatibility, restore it as a soft-deprecated shim that forwards to the shared helper, mirroring the block_core_navigation_link_render_submenu_icon() deprecation. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/navigation-link/index.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/block-library/src/navigation-link/index.php b/packages/block-library/src/navigation-link/index.php index 8201d8c5ced823..2144dfc9c2f315 100644 --- a/packages/block-library/src/navigation-link/index.php +++ b/packages/block-library/src/navigation-link/index.php @@ -81,6 +81,25 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is return $colors; } +/** + * Build an array with CSS classes and inline styles defining the font sizes + * which will be applied to the navigation markup in the front-end. + * + * @since 5.9.0 + * @deprecated 7.0.0 Use block_core_shared_navigation_build_css_font_sizes() instead. + * + * @param array $context Navigation block context. + * @return array Font size CSS classes and inline styles. + */ +function block_core_navigation_link_build_css_font_sizes( $context ) { + _deprecated_function( + __FUNCTION__, + '7.0.0', + 'block_core_shared_navigation_build_css_font_sizes()' + ); + return block_core_shared_navigation_build_css_font_sizes( $context ); +} + /** * Returns the top-level submenu SVG chevron icon. * From bcc48d5cebf3a884ca4002fef22d0459ab4f8ecd Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Tue, 2 Jun 2026 20:54:23 +0900 Subject: [PATCH 12/15] wp-build: Revert inline-styles helper extraction in wp-admin page template The wp_admin_inline_styles() function and its wp_add_inline_style() wiring introduced a new function unrelated to this PR's scope (code quality and 7.0 backward-compatibility fixes). Restore the original inline +
Date: Wed, 3 Jun 2026 21:54:11 +0900 Subject: [PATCH 13/15] Navigation Link: Make deprecated font-size helper self-contained The trunk merge removed block_core_shared_navigation_build_css_font_sizes() (and its file) when font-size propagation was dropped from navigation items. The backward-compat shim block_core_navigation_link_build_css_font_sizes() still forwarded to that now-missing helper, which would fatal when called and left the deprecation notice pointing at a function that no longer exists. Inline the original @since 5.9.0 logic so the shim is self-contained, drop the invalid replacement reference, and document that it is retained solely for third-party callers. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/navigation-link/index.php | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/packages/block-library/src/navigation-link/index.php b/packages/block-library/src/navigation-link/index.php index cf9f2fe4640ff9..464e79aa343d5d 100644 --- a/packages/block-library/src/navigation-link/index.php +++ b/packages/block-library/src/navigation-link/index.php @@ -84,19 +84,43 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the navigation markup in the front-end. * + * This function is no longer used internally and is kept only for backward + * compatibility with third-party code that may call it directly. + * * @since 5.9.0 - * @deprecated 7.0.0 Use block_core_shared_navigation_build_css_font_sizes() instead. + * @deprecated 7.0.0 * * @param array $context Navigation block context. * @return array Font size CSS classes and inline styles. */ function block_core_navigation_link_build_css_font_sizes( $context ) { - _deprecated_function( - __FUNCTION__, - '7.0.0', - 'block_core_shared_navigation_build_css_font_sizes()' + _deprecated_function( __FUNCTION__, '7.0.0' ); + + // CSS classes. + $font_sizes = array( + 'css_classes' => array(), + 'inline_styles' => '', ); - return block_core_shared_navigation_build_css_font_sizes( $context ); + + $has_named_font_size = array_key_exists( 'fontSize', $context ); + $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); + + if ( $has_named_font_size ) { + // Add the font size class. + $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); + } elseif ( $has_custom_font_size ) { + // Add the custom font size inline style. + $font_sizes['inline_styles'] = sprintf( + 'font-size: %s;', + wp_get_typography_font_size_value( + array( + 'size' => $context['style']['typography']['fontSize'], + ) + ) + ); + } + + return $font_sizes; } /** From 6037cac15edca426c7bc726815bf2a380d3985be Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Wed, 15 Jul 2026 19:51:58 +0900 Subject: [PATCH 14/15] wp-build: Add CHANGELOG entry for admin_footer hook_suffix fix The generated single-page admin template now passes the current $hook_suffix to the admin_footer action instead of an empty string. This restores parity with wp-admin/admin-footer.php so hooks relying on the argument fire correctly. Adds the missing CHANGELOG entry required by the Check CHANGELOG diff CI job. Co-Authored-By: Claude --- packages/wp-build/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/wp-build/CHANGELOG.md b/packages/wp-build/CHANGELOG.md index ff839bdeb57071..4332627371f6f1 100644 --- a/packages/wp-build/CHANGELOG.md +++ b/packages/wp-build/CHANGELOG.md @@ -16,6 +16,7 @@ ### Bug Fixes - Widen the optional `@wordpress/theme` peer dependency range to allow 1.x releases and preserve automatic design token fallback plugin loading ([#80089](https://github.com/WordPress/gutenberg/pull/80089)). +- Pass the current `$hook_suffix` to the `admin_footer` action in the generated single-page admin template instead of an empty string ([#75985](https://github.com/WordPress/gutenberg/pull/75985)). ## 0.18.0 (2026-07-01) From 312e3fc967a3ce696550877130530646bb91043d Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sat, 18 Jul 2026 20:34:45 +0900 Subject: [PATCH 15/15] wp-build: Move changelog entry to the Unreleased section The #75985 bug fix entry was placed under the already-released 0.19.0 section. Move it to the Unreleased section so it is included in the next release notes. --- packages/wp-build/CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/wp-build/CHANGELOG.md b/packages/wp-build/CHANGELOG.md index 79fac09942c422..e566337545a245 100644 --- a/packages/wp-build/CHANGELOG.md +++ b/packages/wp-build/CHANGELOG.md @@ -7,6 +7,10 @@ - Widgets: carry a widget's declarative `actions` from `widget.json` into the generated PHP registry ([#80363](https://github.com/WordPress/gutenberg/pull/80363)). +### Bug Fixes + +- Pass the current `$hook_suffix` to the `admin_footer` action in the generated single-page admin template instead of an empty string ([#75985](https://github.com/WordPress/gutenberg/pull/75985)). + ## 0.19.0 (2026-07-14) ### Enhancements @@ -23,7 +27,6 @@ ### Bug Fixes - Widen the optional `@wordpress/theme` peer dependency range to allow 1.x releases and preserve automatic design token fallback plugin loading ([#80089](https://github.com/WordPress/gutenberg/pull/80089)). -- Pass the current `$hook_suffix` to the `admin_footer` action in the generated single-page admin template instead of an empty string ([#75985](https://github.com/WordPress/gutenberg/pull/75985)). ## 0.18.0 (2026-07-01)