Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Manage Taxonomies
- function tax_hadle_func($post_id, $post) {
- $boat_ids = toolset_get_related_posts($post_id, 'boat-product', 'child');
- $child_terms = get_the_terms( $post_id, 'boat-cat' );
- $child_term_ids = wp_list_pluck( $child_terms, 'term_id' );
- remove_action('save_post', 'tax_hadle_func',30,2);
- add_action('save_post', 'tax_hadle_func',30,2);
- foreach ($boat_ids as $boat_id) {
- wp_set_post_terms( $boat_id, $child_term_ids, 'boat-cat', true );
- }
- }
- add_action('save_post', 'tax_hadle_func',30,2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement