Astra_Abilities_Helper::update_font_extras( array $args, string $option_key )
Update font extras (line_height, text_transform, letter_spacing).
Description
Parameters
- $args
-
(array) (Required) Input arguments containing font extras.
- $option_key
-
(string) (Required) The option key to update.
Return
(void)
Source
File: inc/abilities/class-astra-abilities-helper.php
public static function update_font_extras( $args, $option_key ) {
if ( ! isset( $args['line_height'] ) && ! isset( $args['text_transform'] ) && ! isset( $args['letter_spacing'] ) ) {
return;
}
$font_extras = astra_get_option( $option_key, array() );
if ( isset( $args['line_height'] ) ) {
$font_extras['line-height'] = sanitize_text_field( $args['line_height'] );
}
if ( isset( $args['text_transform'] ) ) {
$font_extras['text-transform'] = sanitize_text_field( $args['text_transform'] );
}
if ( isset( $args['letter_spacing'] ) ) {
$font_extras['letter-spacing'] = sanitize_text_field( $args['letter_spacing'] );
}
astra_update_option( $option_key, $font_extras );
}
Expand full source code Collapse full source code View on Trac