post_type === 'page' ) { $title = $page_for_posts->post_title; } else { $title = __( 'Latest Posts', 'blockify' ); } $content = str_replace( $text, $title, $content ); } if ( $padding = $block['attrs']['style']['spacing']['padding'] ?? false ) { $styles = []; foreach ( $padding as $key => $value ) { $styles[ 'padding-' . $key ] = $value; } $dom = dom( $content ); /** * @var $first DOMElement */ $first = $dom->firstChild; $first->setAttribute( 'style', css_array_to_string( $styles ) . ';' . $first->getAttribute( 'style' ) ); $content = $dom->saveHTML(); } return $content; }