Make WordPress Core


Ignore:
Timestamp:
05/18/2024 11:16:09 PM (11 months ago)
Author:
isabel_brison
Message:

Editor: pass fluid typography theme.json settings to wp_get_typography_font_size_value.

Updates wp_get_typography_font_size_value to accept an array of theme.json settings instead of a boolean derived from global state.

Props ramonopoly, audrasjb.
Fixes #61118.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r58123 r58171  
    18321832     *
    18331833     * @since 5.9.0
     1834     * @since 6.6.0 Passing $settings to the callbacks defined in static::PRESETS_METADATA.
    18341835     *
    18351836     * @param array    $settings        Settings to process.
     
    18581859                ) {
    18591860                    $value_func = $preset_metadata['value_func'];
    1860                     $value      = call_user_func( $value_func, $preset );
     1861                    $value      = call_user_func( $value_func, $preset, $settings );
    18611862                } else {
    18621863                    // If we don't have a value, then don't add it to the result.
     
    20512052     * @since 6.1.0 Added `$theme_json`, `$selector`, and `$use_root_padding` parameters.
    20522053     * @since 6.5.0 Output a `min-height: unset` rule when `aspect-ratio` is set.
     2054     * @since 6.6.0 Passing current theme JSON settings to wp_get_typography_font_size_value().
    20532055     *
    20542056     * @param array   $styles Styles to process.
     
    21182120                 * Values that already have a clamp() function will not pass the test,
    21192121                 * and therefore the original $value will be returned.
     2122                 * Pass the current theme_json settings to override any global settings.
    21202123                 */
    2121                 $value = wp_get_typography_font_size_value( array( 'size' => $value ) );
     2124                $value = wp_get_typography_font_size_value( array( 'size' => $value ), $settings );
    21222125            }
    21232126
Note: See TracChangeset for help on using the changeset viewer.