• Hi everyone, I need some help with wp_insert_term(), its not doing what I think should be doing.

    I created a custom post type called car_listings and then added a taxonomy to it:

    register_taxonomy('car_cylinders', 'car_listings', $args);

    I’m now trying to do the following without success:

    wp_insert_term('4', 'car_cylinders');

    Am I jumping steps here? I think that’s the correct way of doing it because I don’t need to set a parent or anything, just add 4 the car_cylinders taxonomy.

    Can anyone help me? Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter Yojance Rabelo

    (@yojance)

    I turn the code into a function and then added the function to init and it worked. The problem I’m having now is that when I try to delete it through the back-end, it doesn’t let me.

    I wonder if it has anything to do with me working on my localhost.
    Any suggestions?

Viewing 1 replies (of 1 total)
  • The topic ‘wp_insert_term() Help’ is closed to new replies.