_wp_get_presets_class_name example

// return early if no settings are found on the block attributes.     $block_settings = _wp_array_get( $block, array( 'attrs', 'settings' ), null );
    if ( empty( $block_settings ) ) {
        return $block_content;
    }

    // Like the layout hook this assumes the hook only applies to blocks with a single wrapper.     // Add the class name to the first element, presuming it's the wrapper, if it exists.     $tags = new WP_HTML_Tag_Processor( $block_content );
    if ( $tags->next_tag() ) {
        $tags->add_class( _wp_get_presets_class_name( $block ) );
    }

    return $tags->get_updated_html();
}

/** * Render the block level presets stylesheet. * * @internal * * @since 6.2.0 * @since 6.3.0 Updated preset styles to use Selectors API. * @access private * * @param string|null $pre_render The pre-rendered content. Default null. * @param array $block The block being rendered. * * @return null */
Home | Imprint | This part of the site doesn't use cookies.