Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function save_book_meta( $post_id, $post, $update ) {
- $slug = 'book'; //Slug of CPT
- // If this isn't a 'book' post, don't update it.
- if ( $slug != $post->post_type ) {
- return;
- }
- wp_set_object_terms( get_the_ID(), $term_id, $taxonomy );
- }
- add_action( 'save_post', 'save_book_meta', 10, 3 );
Add Comment
Please, Sign In to add comment