WP provides a function to insert terms:
<?php wp_insert_term( $term, $taxonomy, $args = array() ); ?>
I have 60 $terms, each has its own $args, I want to prepare the 60 terms as an array, then, insert them at once. Is this posible? How?
WP provides a function to insert terms:
<?php wp_insert_term( $term, $taxonomy, $args = array() ); ?>
I have 60 $terms, each has its own $args, I want to prepare the 60 terms as an array, then, insert them at once. Is this posible? How?
You must be logged in to post a comment.
As far as the codex for wp_insert_term says, it is not possible to insert an array directly. Put all your terms in an array, then foreach over it and inside every turn, call
wp_insert_term
once per term.