Function extension
The issue arises because str_replace() is replacing partial matches (like “POA” inside “POA (+)”). To fix this and ensure only exact matches are replaced, we can switch to using regular expressions with preg_replace(). Here’s a refined version of your function: function auto_link_post_titles( $content, $post_id, $field ) { $excluded_ids = array(); $excluded_field_names = array(); if ( … Read more