wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_get_block_style_variation_name_from_class › WordPress Function

Seit6.6.0
Veraltetn/v
wp_get_block_style_variation_name_from_class ( $class_string )
Parameter:
  • (string) $class_string CSS class string to look for a variation in.
    Erforderlich: Ja
Gibt zurück:
  • (array|null) The block style variation name if found.
Definiert in:
Codex:

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



Quellcode

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

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