WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can you use term_exists from with in Javascript loop? (1 post)

  1. iyamdman
    Member
    Posted 2 years ago #

    I have a Javascript in the function.php file, that works well to generate a part code.

    When I try to add the code to a taxonomy, I get an error saying that:

    Error: term_exists is not defined

    It comes from this if statement in the script:

    // Add Code to taxonomy
                    if (term_exists(code, wheel_type)) {
                         alert(code);
                         }
                    else
                         {
                         wp_insert_term(code, wheel_type);
                         }

    Can anyone tell me what I did wrong, or how to add a term to a taxonomy from with in a Javascript section?

Topic Closed

This topic has been closed to new replies.

About this Topic