Last active
March 27, 2018 20:38
-
-
Save jrgd/3be90fa57c9be0e1fa95e30b1dade693 to your computer and use it in GitHub Desktop.
Set Term (custom taxonomy) on post programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$term = wp_create_term($term_name, 'taxonomy'); // will return existing term if exists already | |
wp_set_post_terms($post_id, $term_name, 'taxonomy'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment