• I am writing a plugin to add a category ‘MostRecent’ to a post whenever its published and remove it of the other posts.

    I got this working by performing a delete in term_relationships followed by an insert.

    This plugin then hooks into new_to_publish etc and this works fine.

    What I noticed is that this way , the count in the wp_term_taxonomy is not maintained.

    Are there functions that I can use to manipulate the categories of a post instaid of direct database access and that maintain the count of the category ?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘nice way to modify categories with code ?’ is closed to new replies.