Way overthinking it:
<?php
add_filter('wpseo_opengraph_desc', function () use (&$data) {
$seo_intro = trim($data->seo_intro);
if ($seo_intro === '') {
$seo_intro = "{$data->name} - {$data->title}";
}
return esc_attr(wp_strip_all_tags(stripslashes(do_shortcode($seo_intro))));
}, PHP_INT_MAX);
?>
Essentially, hijack the content with a filter (since that’s what Yoast is using to derive the description) and make sure it’s the last filter to be ran to return back my predetermined content.
EDIT
Instead of adding a filter on the_content
, use Yoast’s custom filter wpseo_opengraph_desc
.