firstChild; $style = $div->getAttribute( 'style' ) ? $div->getAttribute( 'style' ) . ';' : ''; $div->setAttribute( 'style', $style . '--wp--style--block-gap:' . $block['attrs']['style']['spacing']['blockGap'] ); $content = $dom->saveHTML(); } return $content; } add_filter( 'render_block', NS . 'query_block_filters', 10, 2 ); /** * Description of expected behavior. * * @since 0.0.1 * * @param string $content * @param array $block * * @return string */ function query_block_filters( string $content, array $block ): string { if ( 'core/post-title' === $block['blockName'] ) { if ( is_home() && str_contains( $content, 'post_title, $content ); } } if ( 'core/post-author' === $block['blockName'] ) { $content = str_replace( [ '

' ], [ '' ], $content ); } if ( 'core/post-terms' === $block['blockName'] && isset( $block['attrs']['align'] ) ) { $content = str_replace( [ 'wp-block-post-terms', 'rel="tag"', ], [ 'wp-block-post-terms flex justify-' . $block['attrs']['align'], 'class="wp-block-post-terms__link" rel="tag"', ], $content ); } return $content; }