0

As you know, there is a metabox that suggests tags as you type to input box. Is anyone knows how this function gets the tag's ID (term_id) which is selected? I have looked at some of the core files but it seems only the tag name is retrieved and the ajax response returns only the name, no sign of id.

But it's just impossible as the tag is updated by the tag's ID but not it's name upon submitting or updating the post

The core files i've looked at:

wp-admin/includes/meta-boxes.php
wp-admin/js/post.dev.js
wp-admin/admin-ajax.php
wp-includes/post.php
wp-includes/js/jquery/suggest.dev.js
wp-includes/taxonomy.php
1

It just passes the tag names to wp_update_post(), which eventually calls wp_set_post_tags(), which eventually converts the names to term_ids, using term_exists().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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