1

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?

1
  • This is a great question and probably a lack in wordpress API. Considering more than 600 terms the insertions are really slow !
    – snowflake
    Commented Dec 14, 2015 at 15:21

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.