get_block_element_selectors example

        $blocks = array_diff_key( $blocksstatic::$blocks_metadata );
        if ( empty( $blocks ) ) {
            return static::$blocks_metadata;
        }

        foreach ( $blocks as $block_name => $block_type ) {
            $root_selector = wp_get_block_css_selector( $block_type );

            static::$blocks_metadata[ $block_name ]['selector']  = $root_selector;
            static::$blocks_metadata[ $block_name ]['selectors'] = static::get_block_selectors( $block_type$root_selector );

            $elements = static::get_block_element_selectors( $root_selector );
            if ( ! empty( $elements ) ) {
                static::$blocks_metadata[ $block_name ]['elements'] = $elements;
            }

            // The block may or may not have a duotone selector.             $duotone_selector = wp_get_block_css_selector( $block_type, 'filter.duotone' );

            // Keep backwards compatibility for support.color.__experimentalDuotone.             if ( null === $duotone_selector ) {
                $duotone_support = _wp_array_get( $block_type->supports, array( 'color', '__experimentalDuotone' ), null );

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