wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_get_block_style_variation_name_from_class › WordPress Function

Depuis6.6.0
Dépréciéen/a
wp_get_block_style_variation_name_from_class ( $class_string )
Paramètres:
  • (string) $class_string CSS class string to look for a variation in.
    Requis: Oui
Retourne:
  • (array|null) The block style variation name if found.
Défini(e) dans:
Codex:

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



Source

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;
}