wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_typography_classes_for_block_core_search › WordPress Function

Odn/a
Przestarzałyn/a
get_typography_classes_for_block_core_search ( $attributes )
Parametry:
  • (array) $attributes The block attributes.
    Wymagane: Tak
Powrót:
  • (string) The typography color classnames to be applied to the block elements.
Zdefiniowane na:
Codex:

Returns typography classnames depending on whether there are named font sizes/families .



Źródło

function get_typography_classes_for_block_core_search( $attributes ) {
	$typography_classes    = array();
	$has_named_font_family = ! empty( $attributes['fontFamily'] );
	$has_named_font_size   = ! empty( $attributes['fontSize'] );

	if ( $has_named_font_size ) {
		$typography_classes[] = sprintf( 'has-%s-font-size', esc_attr( $attributes['fontSize'] ) );
	}

	if ( $has_named_font_family ) {
		$typography_classes[] = sprintf( 'has-%s-font-family', esc_attr( $attributes['fontFamily'] ) );
	}

	return implode( ' ', $typography_classes );
}