Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array(
- 'category' => CURRENT_CATEGORY_ID,
- );
- $posts_to_change = get_posts( $args );
- foreach ( $posts_to_change as $new_category_post ) {
- wp_set_post_categories( $new_category_post->ID, array(NEW_CATEGORY_ID) );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement