Custom Taxonomy Autocomplete issue

Hi,
after creating custom taxonomy (non-hierarchical), the autocomplete behavior seems to not work as expected - it suggests the entries from default taxonomy (post_tag) instead of the customely created.

Here is the preview from ClassicPress (my custom taxonomy is named “cl-tags”) but is suggest entries from “post_tag”:

Here is the preview from Wordpress (exact same scenario), works good and looks well:

From my perspective the aesthetics side of this element (in CP) need some improvements too.

Kind Regards, DJ.

Your image shows the default tag metabox, so that will show post_tag options. Have you checked Screen options to see if your custom taxonomy is checked?

As for the display mode, last time I checked this, CP looked the same as WP. Maybe there’s been a change I hadn’t noticed, but have you ensured that you’ve cleared all caches to ensure you aren’t seeing a browser artifact?

when creating custom taxonomy you can choose the label, I used “Tags”, thats why you think it’s default tag metabox, but it’s not, this metabox is for custom taxonomy, believe me.

If there are now two metaboxes with the same label, how do you know if you’re looking at the intended one?

still need another proofs?

I don’t need “proof”. I was just asking if you’d checked the Screen Options. Interestingly enough, the images you’ve provided suggests you haven’t.

why do you ask to check and provide proofs for things not-related to the topic?
my custom post type has only custom taxonomies so I don’t need to check “Screen Options” to satisfy your wrong assumptions, but if you really need it,

I didn’t make any assumptions. I asked a question. That’s the very opposite of making an assumption. When someone seeks assistance, it’s pretty normal to ask them first to check something. I’m sorry if this upsets you.

When I can get to an appropriate device, I will look into your issue further .

This problem - working with custom non-hierarchical taxonomy - was very troublesome for me, and I was little bit disapointed by ClassicPress, so forgive me please my reaction.

Here is what I found, Wordpress uses AJAX method to show suggestions based on what you type (3 letters min), while ClassicPress inserts HTML <datalist id="tags-list"> element with options. For each taxonomy, this element has always the same id tags-list no matter what’s the taxonomy name and how much of them exists on the page,

The source code of this function is located here
wp-admin/includes/meta-boxes.php

As we can see, the code was already edited for ClassicPress, but it’s not correct

Here is my fix,
it also includes fixing HTML ID conflict for multiple taxonomy presence on post-edit page,
now everything works, finally :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

Thanks for this. I can confirm the problem and your solution (though I would not use md5() here as it makes for opaque HTML). I’ll create a PR.