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 all 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 |
|---|---|---|
|
|
@@ -80,6 +80,66 @@ 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. | ||
| * | ||
| * 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 | ||
| * | ||
| * @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' ); | ||
|
|
||
| // CSS classes. | ||
| $font_sizes = array( | ||
| 'css_classes' => array(), | ||
| 'inline_styles' => '', | ||
| ); | ||
|
|
||
| $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; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the top-level submenu SVG chevron icon. | ||
| * | ||
| * @since 5.9.0 | ||
| * @deprecated 7.0.0 Use block_core_shared_navigation_render_submenu_icon() instead. | ||
| * | ||
| * @return string | ||
| */ | ||
| function block_core_navigation_link_render_submenu_icon() { | ||
|
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. Regarding the
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. Or here if it's more convenient 😄 |
||
| _deprecated_function( | ||
| __FUNCTION__, | ||
| '7.0.0', | ||
| 'block_core_shared_navigation_render_submenu_icon()' | ||
| ); | ||
| return block_core_shared_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. | ||
| * | ||
|
|
||
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.
This is what I restored. This function was deleted by #74855, but I believe it needs to be restored to maintain full backward compatibility.