wp_get_typography_value_and_unit ( $raw_value, $options = array() )

  • (string|int|float) raw_value Raw size value from theme.json.
  • (array) options { Optional. An associative array of options. Default is empty array. @type string $coerce_to Coerce the value to rem or px. Default `'rem'`. @type int $root_size_value Value of root font size for rem|em <-> px conversion. Default `16`. @type string[] $acceptable_units An array of font size units. Default `array( 'rem', 'px', 'em' )`; }
  • (array|null) An array consisting of `'value'` and `'unit'` properties on success. `null` on failure.
Defined at:


Checks a string for a unit and value and returns an array consisting of `'value'` and `'unit'`, e.g. array( '42', 'rem' ).

Related Functions

wp_get_typography_font_size_value, wp_get_computed_fluid_typography_value, wp_register_typography_support, wp_migrate_old_typography_shape, wp_render_typography_support

Top Google Results

User discussions

wpseek mobile