do_blocks()
Parses dynamic blocks out of post_content re-renders them.
Хуков нет.
Возвращает
Строку
. Updated post content.
Использование
do_blocks( $content );
- $content(строка) (обязательный)
- Post content.
Список изменений
С версии 5.0.0 | Введена. |
Код do_blocks() do blocks WP 6.8
function do_blocks( $content ) { $blocks = parse_blocks( $content ); $output = ''; foreach ( $blocks as $block ) { $output .= render_block( $block ); } // If there are blocks in this content, we shouldn't run wpautop() on it later. $priority = has_filter( 'the_content', 'wpautop' ); if ( false !== $priority && doing_filter( 'the_content' ) && has_blocks( $content ) ) { remove_filter( 'the_content', 'wpautop', $priority ); add_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 ); } return $output; }