get_the_block_template_html()

最后更新于:2021-11-27 01:36:12

get_the_block_template_html()

响应s the markup for the current template.

响应

(string) Block template markup.

源文件

文件: gc-includes/block-template.php

function get_the_block_template_html() {
	global $_gc_current_template_content;
	global $gc_embed;

	if ( ! $_gc_current_template_content ) {
		if ( is_user_logged_in() ) {
			return '<h1>' . esc_html__( 'No matching template found' ) . '</h1>';
		}
		return;
	}

	$content = $gc_embed->run_shortcode( $_gc_current_template_content );
	$content = $gc_embed->autoembed( $content );
	$content = do_blocks( $content );
	$content = gctexturize( $content );
	$content = gc_filter_content_tags( $content );
	$content = str_replace( ']]>', ']]&gt;', $content );

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