Tag Info

New answers tagged

0

@Bainternet's answer got me on the right track, for storing a comma separated string of tags as individual tags in the database and associate each individual tag with the proper post. I needed this, because I have a form field which allows users to enter a list of comma separated tags. Anyway, here's the complete code I use: // Sanitize user/form input ...


0

$_POST['tax_input[genres]'] should be $_POST['tax_input']['genres']


1

I hope I understand this correctly. You can simply just add your post ID's in an array and then use a foreach loop to loop through the ID's and checking whether or not they have the term to assign or not, and if not, assign the term to the post $post_ids = [4522, 4524, 4526, 4528, 4530]; // array of post ID's foreach ( $post_ids as $id ) { if ( ...


0

To set the taxonomy post_tag to your custom post type, you need to set the taxonomies parameter in your arguments when registering your post type taxonomies (array) (optional) An array of registered taxonomies like category or post_tag that will be used with this post type. This can be used in lieu of calling register_taxonomy_for_object_type() ...



Top 50 recent answers are included