| @@ -149,26 +149,12 @@ | ||
| 149 | 149 | $area = WP_TEMPLATE_PART_AREA_UNCATEGORIZED; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | // Run through the actions that are typically taken on the_content. |
| 153 | - $content = shortcode_unautop( $content ); | |
| 154 | - $content = do_shortcode( $content ); | |
| 155 | - $seen_ids[ $template_part_id ] = true; | |
| 156 | - $content = do_blocks( $content ); | |
| 157 | - unset( $seen_ids[ $template_part_id ] ); | |
| 158 | - $content = wptexturize( $content ); | |
| 159 | - $content = convert_smilies( $content ); | |
| 160 | - $content = wp_filter_content_tags( $content, "template_part_{$area}" ); | |
| 153 | + $content = _wp_apply_block_content_filters( $content, "template_part_{$area}", $seen_ids, $template_part_id ); | |
| 161 | 154 | |
| 162 | - /** | |
| 163 | - * Handle embeds for block template parts. | |
| 164 | - * | |
| 165 | - * @global WP_Embed $wp_embed WordPress Embed object. | |
| 166 | - */ | |
| 167 | - global $wp_embed; | |
| 168 | - $content = $wp_embed->autoembed( $content ); | |
| 169 | - | |
| 170 | - if ( empty( $attributes['tagName'] ) || tag_escape( $attributes['tagName'] ) !== $attributes['tagName'] ) { | |
| 155 | + $tag_name = $attributes['tagName'] ?? null; | |
| 156 | + if ( empty( $tag_name ) || ! is_string( $tag_name ) || tag_escape( $tag_name ) !== $tag_name ) { | |
| 171 | 157 | $area_tag = 'div'; |
| 172 | 158 | if ( $area_definition && isset( $area_definition['area_tag'] ) ) { |
| 173 | 159 | $area_tag = $area_definition['area_tag']; |
| 174 | 160 | } |