Powered By Blogger
Showing posts with label custom tag. Show all posts
Showing posts with label custom tag. Show all posts

Wednesday, November 16, 2016

Programmatically Add Post Terms OR custom taxonomy update for post in WordPress

https://tommcfarlin.com/programmatically-add-post-terms/

//custom taxonomy name
$taxonomy = 'location';
$term = term_exists( $user_address, $taxonomy );
// Then we can set the taxonomy
wp_set_post_terms( $postid, $term, $taxonomy, true );