Pergunta

I have a post ID and I'm just trying to find a function ( I was thinking of something similar to wp_update_post() ) where I can just pass a post ID and maybe a category ID or slug and have it associate the post to the category. Does that exist or have you seen a plugin doing that where I can peek at what they did?

Foi útil?

Solução

wp_set_object_terms() is native function that assigns term from taxonomy to post.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a wordpress.stackexchange
scroll top