Turns out the answer to my question appears to be yes, patterns are no longer filterable through the_content
. At least not directly in a way where you can filter them out of the content easily like you can a standard block.
For anyone looking, I wound up querying for the pattern directly then including in the partial I needed it in. Because I couldn’t filter it out of the content, this resulted in two instances of the block on the page. After trial and error, I wound up just hiding the fist (incorrectly placed) instance using a slightly involved sibling selector. All of this looked like this:
defining the function to query for the pattern by title:
// $block_title is the registered display title of the block
function elseloop_get_this_block($block_title="This Block") {
// query for post_type 'wp_block'
$query = new WP_Query(
array(
'post_type' => 'wp_block',
'title' => $block_title,
'post_status' => 'published',
'posts_per_page' => 1,
)
);
// if there's content, run it through 'the_content' and return it
if (!empty($query->post)) {
$reusable_block = $query->post;
$reusable_block_content = apply_filters('the_content', $reusable_block->post_content);
return $reusable_block_content;
} else {
return '';
}
}
using it in my template partial:
<div class="partial__this-block">
<?php elseloop_get_this_block('This Block'); ?>
</div>
and finally CSS to hide the first instance:
/* selects the first instance by ensuring it has a known sibling the second instance would never have */
.partial__this-block:has(~ .known-sibling) {
display: none;
}