Can you use term_exists from with in Javascript loop?
-
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?
The topic ‘Can you use term_exists from with in Javascript loop?’ is closed to new replies.