Function Signature:
block_core_navigation_link_build_css_font_sizes
Function Description:
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.
Function Examples:
⚠️ Examples below are generated with GPT-3 once every hour. Do not take them too seriously.
Consider them as some extra input in your learning process - reason about them. Will it work? What could fail?
// Example 1: Setting custom font sizes for navigation links in WordPress block editor
add_filter( 'block_core_navigation_link_build_css_font_sizes', function( $font_sizes ) {
$font_sizes['small'] = '14px'; // Custom font size for small navigation links
$font_sizes['medium'] = '18px'; // Custom font size for medium navigation links
$font_sizes['large'] = '24px'; // Custom font size for large navigation links
return $font_sizes;
});
// Example 2: Adjusting font sizes based on screen size for responsive navigation links
add_filter( 'block_core_navigation_link_build_css_font_sizes', function( $font_sizes ) {
$font_sizes['small'] = '14px'; // Font size for small screens
$font_sizes['medium'] = '18px'; // Font size for medium screens
$font_sizes['large'] = '24px'; // Font size for large screens
$font_sizes['xlarge'] = '28px'; // Font size for extra large screens
return $font_sizes;
});
// Example 3: Overriding default font sizes with a custom function for navigation links
function custom_navigation_link_font_sizes( $font_sizes ) {
$font_sizes['small'] = '16px'; // Custom font size for small navigation links
$font_sizes['medium'] = '20px'; // Custom font size for medium navigation links
$font_sizes['large'] = '26px'; // Custom font size for large navigation links
return $font_sizes;
}
add_filter( 'block_core_navigation_link_build_css_font_sizes', 'custom_navigation_link_font_sizes' );