block_default_classname
Filters the default block className for server rendered blocks.
Usage
add_filter( 'block_default_classname', 'wp_kama_block_default_classname_filter', 10, 2 ); /** * Function for `block_default_classname` filter-hook. * * @param string $class_name The current applied classname. * @param string $block_name The block name. * * @return string */ function wp_kama_block_default_classname_filter( $class_name, $block_name ){ // filter... return $class_name; }
- $class_name(string)
- The current applied classname.
- $block_name(string)
- The block name.
Changelog
Since 5.6.0 | Introduced. |
Where the hook is called
block_default_classname
wp-includes/block-supports/generated-classname.php 36
$classname = apply_filters( 'block_default_classname', $classname, $block_name );