do_blocks example

return '';
    }

    $slug     = $attributes['slug'];
    $registry = WP_Block_Patterns_Registry::get_instance();

    if ( ! $registry->is_registered( $slug ) ) {
        return '';
    }

    $pattern = $registry->get_registered( $slug );
    return do_blocks( $pattern['content'] );
}

add_action( 'init', 'register_block_core_pattern' );
if ( 'publish' !== $reusable_block->post_status || ! empty( $reusable_block->post_password ) ) {
        return '';
    }

    $seen_refs[ $attributes['ref'] ] = true;

    // Handle embeds for reusable blocks.     global $wp_embed;
    $content = $wp_embed->run_shortcode( $reusable_block->post_content );
    $content = $wp_embed->autoembed( $content );

    $content = do_blocks( $content );
    unset( $seen_refs[ $attributes['ref'] ] );
    return $content;
}

/** * Registers the `core/block` block. */
function register_block_core_block() {
    register_block_type_from_metadata(
        __DIR__ . '/block',
        array(
            
if ( ! $_wp_current_template_content ) {
        if ( is_user_logged_in() ) {
            return '<h1>' . esc_html__( 'No matching template found' ) . '</h1>';
        }
        return;
    }

    $content = $wp_embed->run_shortcode( $_wp_current_template_content );
    $content = $wp_embed->autoembed( $content );
    $content = shortcode_unautop( $content );
    $content = do_shortcode( $content );
    $content = do_blocks( $content );
    $content = wptexturize( $content );
    $content = convert_smilies( $content );
    $content = wp_filter_content_tags( $content, 'template' );
    $content = str_replace( ']]>', ']]&gt;', $content );

    // Wrap block template in .wp-site-blocks to allow for specific descendant styles     // (e.g. `.wp-site-blocks > *`).     return '<div class="wp-site-blocks">' . $content . '</div>';
}

/** * Renders a 'viewport' meta tag. * * This is hooked into {@see 'wp_head'} to decouple its output from the default template canvas. * * @access private * @since 5.8.0 */


    // If $area is not allowed, set it back to the uncategorized default.     if ( ! $area_definition ) {
        $area = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
    }

    // Run through the actions that are typically taken on the_content.     $content                       = shortcode_unautop( $content );
    $content                       = do_shortcode( $content );
    $seen_ids[ $template_part_id ] = true;
    $content                       = do_blocks( $content );
    unset( $seen_ids[ $template_part_id ] );
    $content = wptexturize( $content );
    $content = convert_smilies( $content );
    $content = wp_filter_content_tags( $content, "template_part_{$area});

    // Handle embeds for block template parts.     global $wp_embed;
    $content = $wp_embed->autoembed( $content );

    if ( empty( $attributes['tagName'] ) ) {
        $area_tag = 'div';
        

function block_template_part( $part ) {
    $template_part = get_block_template( get_stylesheet() . '//' . $part, 'wp_template_part' );
    if ( ! $template_part || empty( $template_part->content ) ) {
        return;
    }
    echo do_blocks( $template_part->content );
}

/** * Prints the header block template part. * * @since 5.9.0 */
function block_header_area() {
    block_template_part( 'header' );
}

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