Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
70c397f
Correct since annotation for block_core_page_list_get_submenu_visibil…
peterwilsoncc Feb 26, 2026
9fd62bc
Correct since annotation for block_core_navigation_get_submenu_visibi…
peterwilsoncc Feb 26, 2026
1457321
Soft deprecate block_core_navigation_link_render_submenu_icon().
peterwilsoncc Feb 26, 2026
daeeaff
Use WP_Styles API for inline styles.
peterwilsoncc Feb 27, 2026
df4fa9f
Document the {{PAGE_SLUG}}-wp-admin_init actions.
peterwilsoncc Feb 27, 2026
8c92fd1
Pass hook suffix to admin_footer action.
peterwilsoncc Feb 27, 2026
acf006b
Document {{PAGE_SLUG}}_init hook
peterwilsoncc Feb 27, 2026
9ae2dad
Remove duplicate documentation for actions.
peterwilsoncc Feb 27, 2026
3839d85
Update CSS comments so they are actually comments 🤦‍♂️
peterwilsoncc Mar 1, 2026
2d2cf8e
Apply suggestions from code review
peterwilsoncc Mar 2, 2026
438c808
Merge remote-tracking branch 'origin/trunk' into fix/75984-misc-fixes
t-hamano May 31, 2026
92fc84b
Navigation Link: Soft deprecate block_core_navigation_link_build_css_…
t-hamano May 31, 2026
eed8864
Merge remote-tracking branch 'origin/trunk' into fix/75984-misc-fixes
t-hamano Jun 2, 2026
bcc48d5
wp-build: Revert inline-styles helper extraction in wp-admin page tem…
t-hamano Jun 2, 2026
18f2ad6
Merge branch 'trunk' into fix/75984-misc-fixes
t-hamano Jun 3, 2026
835b408
Navigation Link: Make deprecated font-size helper self-contained
t-hamano Jun 3, 2026
a7db588
Merge branch 'trunk' into fix/75984-misc-fixes
t-hamano Jun 24, 2026
eec77bf
Merge branch 'trunk' into fix/75984-misc-fixes
t-hamano Jul 11, 2026
a657043
Merge branch 'trunk' into fix/75984-misc-fixes
t-hamano Jul 14, 2026
6037cac
wp-build: Add CHANGELOG entry for admin_footer hook_suffix fix
t-hamano Jul 15, 2026
66d0ef6
Merge branch 'trunk' into fix/75984-misc-fixes
t-hamano Jul 16, 2026
33e83d1
Merge branch 'trunk' into fix/75984-misc-fixes
t-hamano Jul 18, 2026
312e3fc
wp-build: Move changelog entry to the Unreleased section
t-hamano Jul 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/block-library/src/navigation-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the block_core_navigation_submenu_render_submenu_icon function, please note that it is being restored by #78484.

cc @westonruter @ramonjd

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or here if it's more convenient 😄

_deprecated_function(
__FUNCTION__,
'7.0.0',
'block_core_navigation_render_submenu_icon'
);
return block_core_navigation_render_submenu_icon();
}

Comment on lines +126 to +142

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this cannot be moved to deprecated.php in wordpress-develop instead now that it's deprecated and unmaintained going forward?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically block library and other package functions are deprecated in place. If you do a search for _deprecated_ you'll see a bunch of references. I think it's build related so their gutenberg_ counterparts are built and fire the deprecations for users running the plugin.

/**
* Decodes a url if it's encoded, returning the same url if not.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/page-list/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
26 changes: 22 additions & 4 deletions packages/wp-build/templates/page-wp-admin.php.template
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be better as a wp-admin_init-{$page_slug} so it can be documented once as a dynamic hook. Otherwise the docs parser will be full of near identical items. With generated files an approach will need to be figured out to avoid duplicate docs within the code base.

MIght also need a generic version that passes the page slug as a parameter.


// Preload REST API data
Expand Down Expand Up @@ -182,6 +184,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(
Expand Down Expand Up @@ -230,7 +236,18 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_pag
*/
function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() {
?>
<style>
<div id="{{PAGE_SLUG}}-wp-admin-app" class="boot-layout-container"></div>
<?php
}
}

if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_inline_styles' ) ) {
/**
* Get the inline styles for the page.
*/
function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_inline_styles() {
ob_start();
?>
/* Critical styles to prevent layout shifts - inlined for immediate application */

/* Background colors */
Expand Down Expand Up @@ -282,9 +299,10 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_pag
overflow-y: initial;
}
}
</style>
<div id="{{PAGE_SLUG}}-wp-admin-app" class="boot-layout-container"></div>
<?php
$styles = ob_get_clean();
Comment thread
peterwilsoncc marked this conversation as resolved.
Resolved
$styles .= "\n//# sourceURL=" . rawurlencode( __FUNCTION__ );
Comment thread
peterwilsoncc marked this conversation as resolved.
Resolved
return $styles;
}
}

Expand Down
30 changes: 8 additions & 22 deletions packages/wp-build/templates/page.php.template
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite correct but I am having trouble figuring out the difference between page and admin page templates.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Page is a full takeover of the screen (like the site editor) and admin page is just a regular page that keeps the wp-admin sidebar and top bar like the font library.

Comment thread
peterwilsoncc marked this conversation as resolved.
Resolved
*/
do_action( '{{PAGE_SLUG}}_init' );

// Enqueue command palette assets for boot-based pages
Expand Down Expand Up @@ -263,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
?>
Expand All @@ -284,12 +278,8 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_render_page' ) ) {
<?php
// BEGIN see wp-admin/admin-footer.php

/**
* Prints scripts or data before the default footer scripts.
*
* @since 1.2.0
*/
do_action( 'admin_footer', '' );
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_footer', $hook_suffix );

// Print import map first so it's available for inline scripts
wp_script_modules()->print_import_map();
Expand All @@ -298,11 +288,7 @@ if ( ! function_exists( '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_render_page' ) ) {
wp_script_modules()->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
?>
Expand Down
Loading