wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_get_block_style_variation_name_from_class › WordPress Function

Since6.6.0
Deprecatedn/a
wp_get_block_style_variation_name_from_class ( $class_string )
Parameters:
  • (string) $class_string CSS class string to look for a variation in.
    Required: Yes
Returns:
  • (array|null) The block style variation name if found.
Defined at:
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;
}