wp_style_engine_get_stylesheet_from_css_rules example



    /** * Appends the used block duotone filter declarations to the inline block supports CSS. * * Uses the declarations saved in earlier calls to self::enqueue_block_css. * * @since 6.3.0 */
    public static function output_block_styles() {
        if ( ! empty( self::$block_css_declarations ) ) {
            wp_style_engine_get_stylesheet_from_css_rules(
                self::$block_css_declarations,
                array(
                    'context' => 'block-supports',
                )
            );
        }
    }

    /** * Appends the used global style duotone filter presets (CSS custom * properties) to the inline global styles CSS. * * Uses the declarations saved in earlier calls to self::enqueue_global_styles_preset. * * @since 6.3.0 */
'declarations' => array(
                    'position' => $position_type,
                    'z-index'  => '10',
                ),
            );
    }

    if ( ! empty( $position_styles ) ) {
        /* * Add to the style engine store to enqueue and render position styles. */
        wp_style_engine_get_stylesheet_from_css_rules(
            $position_styles,
            array(
                'context'  => 'block-supports',
                'prettify' => false,
            )
        );

        // Inject class name to block container markup.         $content = new WP_HTML_Tag_Processor( $block_content );
        $content->next_tag();
        foreach ( $wrapper_classes as $class ) {
            
// Set the CSS variable to the column value, and the `gap` property to the combined gap value.     $gallery_styles = array(
        array(
            'selector'     => ".wp-block-gallery.{$unique_gallery_classname}",
            'declarations' => array(
                '--wp--style--unstable-gallery-gap' => $gap_column,
                'gap'                               => $gap_value,
            ),
        ),
    );

    wp_style_engine_get_stylesheet_from_css_rules(
        $gallery_styles,
        array(
            'context' => 'block-supports',
        )
    );
    return (string) $processed_content;
}
/** * Registers the `core/gallery` block on server. */
function register_block_core_gallery() {
    

        }
    }

    if ( ! empty( $layout_styles ) ) {
        /* * Add to the style engine store to enqueue and render layout styles. * Return compiled layout styles to retain backwards compatibility. * Since https://github.com/WordPress/gutenberg/pull/42452, * wp_enqueue_block_support_styles is no longer called in this block supports file. */
        return wp_style_engine_get_stylesheet_from_css_rules(
            $layout_styles,
            array(
                'context'  => 'block-supports',
                'prettify' => false,
            )
        );
    }

    return '';
}

Home | Imprint | This part of the site doesn't use cookies.