I am using wp_set_post_terms($post_id, $myCategory, 'sources', true );
to set the category of a post, using the custom taxonomy ‘sources’. One of my existing categories is ‘Victoria & Albert Museum’ which I have set up from the main WordPress dashboard without any problems, but when I pass that string as $myCategory
using the code above it creates a new category simply as ‘Victoria’. I have tried escaping the ampersand in several ways but this still hasn’t worked. Any thoughts? I don’t especially want to force it to ‘and’ as that’s not their correct name.
1 comment