Quick update to this, for people who might be interested, I fixed it by knocking up my own plugin which implements this filter:
function plant_articles_filter( $content ) {
global $post;
if( 'plant_lists' == $post->post_type && ! is_search() && is_single() )
{
// stuff that loads when the shortcode is called goes here
$current_title = get_the_title();
$currentID = get_the_ID();
$search_term = html_entity_decode($current_title, ENT_QUOTES);
$search_one = new WP_Query(array(
'order' => 'ASC',
'orderby' => 'title',
's' => $search_term,
'post_status' => null,
'nopaging' => 1,
'post__not_in' => array($currentID),
'posts_per_page' => -10));
$search_term = preg_replace("/[^A-Za-z ]/", '', $current_title);
$search_two = new WP_Query(array(
'order' => 'ASC',
'orderby' => 'title',
's' => $search_term,
'post_status' => null,
'nopaging' => 1,
'post__not_in' => array($currentID),
'posts_per_page' => -10));
$search_three = new WP_Query(array(
'order' => 'ASC',
'orderby' => 'title',
's' => $current_title,
'post_status' => null,
'nopaging' => 1,
'post__not_in' => array($currentID),
'posts_per_page' => -10));
$search_articles = new WP_Query();
$unique = array_unique(array_merge( $search_one->posts, $search_two->posts, $search_three->posts ), SORT_REGULAR);
$search_articles->posts = $unique;
$search_articles->post_count = count( $unique );
$title_search_results = '<h3>Articles that mention ' . $current_title . ':</h3><ul>';
$posts_count = 0;
while($search_articles->have_posts()): $search_articles->the_post();
if( get_permalink() != '' && get_the_title() != '' )
{
$posts_count++;
$title_search_results .= '<li><a href="' . get_permalink() . '">' . get_the_title(). '</a></li>';
}
endwhile;
if( $posts_count == 0 )
{
$title_search_results = '';
}
else
{
$title_search_results .= '</ul>';
}
wp_reset_query();
$content .= $title_search_results;
}
return $content;
}
add_filter( 'the_content', 'plant_articles_filter', 0 );
Works a treat – giving a dynamic bulleted list of articles based on a search on the current article title.
You can see an example here: https://www.pumpkinbeth.com/plants/lathyrus-odoratus-naomi-nazareth/
Hope this helps somebody else in future. ??