Question

Is there a function to add array of post id's to a category,something like this array(2,3,5,6) to put in some category,not looking for update post. Tnx in advance.

Was it helpful?

Solution

Not exactly add array, but you can loop through that array and run wp_set_object_terms() on each post id. Just study function's arguments carefully, because it defaults to overwriting terms, rather that adding.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top