Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

up vote 0 down vote accepted

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().

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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