Auto-Tagging a Custom Post Type

Referenced from https://codex.wordpress.org/Post_Status_Transitions#.7Bstatus.7D_.7Bpost_type.7D_Hook the hook named “{status}_{post_type} Hook”. This hooks is fired, when custom post type “community” is giving the status “publish” = is published. Hook will give post_id and post object as parameters to the callback function. And wp_set_post_terms, requires first parameter as post ID. This should work: add_action(‘publish_community’, ‘community_post_type_tagging’, 10, 2); function community_post_type_tagging($post_id, … Read more

Automatically convert standard posts with custom fields to custom post types

The question: what is the easiest way to convert standard posts with custom fields into a new custom post type There’s no “easy” way. Consider that all posts have custom fields (some are hidden, and WordPress will add them). So you would need to convert post types based on the presence / value of specific … Read more