Repository navigation
Misc fixes for WordPress-Develop 7.0 merges #75985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
70c397f
9fd62bc
1457321
daeeaff
df4fa9f
8c92fd1
acf006b
9ae2dad
3839d85
2d2cf8e
438c808
92fc84b
eed8864
bcc48d5
18f2ad6
835b408
a7db588
eec77bf
a657043
6037cac
66d0ef6
33e83d1
312e3fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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(); | ||
| } | ||
|
|
||
|
Comment on lines
+126
to
+142
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason this cannot be moved to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| /** | ||
| * Decodes a url if it's encoded, returning the same url if not. | ||
| * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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' ); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be better as a MIght also need a generic version that passes the page slug as a parameter. |
||
|
|
||
| // Preload REST API data | ||
|
|
@@ -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( | ||
|
|
@@ -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 */ | ||
|
|
@@ -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(); | ||
|
peterwilsoncc marked this conversation as resolved.
Resolved
|
||
| $styles .= "\n//# sourceURL=" . rawurlencode( __FUNCTION__ ); | ||
|
peterwilsoncc marked this conversation as resolved.
Resolved
|
||
| return $styles; | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
peterwilsoncc marked this conversation as resolved.
Resolved
|
||
| */ | ||
| do_action( '{{PAGE_SLUG}}_init' ); | ||
|
|
||
| // Enqueue command palette assets for boot-based pages | ||
|
|
@@ -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 | ||
| ?> | ||
|
|
@@ -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(); | ||
|
|
@@ -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 | ||
| ?> | ||
|
|
||
There was a problem hiding this comment.
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_iconfunction, please note that it is being restored by #78484.cc @westonruter @ramonjd
There was a problem hiding this comment.
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 😄