Removing sanitize_title_with_dashes Function with The Real Title
wp_add_post_tags($thePostID, $target); assumes that $target is either the slug or ID of a tag. Not all possible values will be valid tag slugs, which is why the sanitize_title_with_dashes is used. So instead, the real problem is that those tags have no human friendly name, just a slug. So instead, fetch the term, use it’s ID, … Read more