wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_get_block_style_variation_name_from_class › WordPress Function

Desde6.6.0
Obsoleton/a
› wp_get_block_style_variation_name_from_class ( $class_string )
Parâmetros:
  • (string|null) $class_string CSS class string to look for a variation in.
    Required: Yes
Retorna:
  • (string[]|null) The block style variation names (empty if none found), or null if a string was not supplied.
Definido em:
Codex:

Determines the block style variation names within a CSS class string.



Fonte

function wp_get_block_style_variation_name_from_class( $class_string ): ?array {
	if ( ! is_string( $class_string ) ) {
		return null;
	}

	preg_match_all( '/\bis-style-(?!default)(\S+)\b/', $class_string, $matches );
	return $matches[1];
}