Skip Navigation

[Resolved] How to get a cutom taxonomy ID?

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 1.23 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by Vane 5 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1358667

Hi,

I created with Toolset a custom taxonomy which slug is "sector".
How can I figure out what is this taxonomy's ID? I want to use it in 3rd party plugin.
I tried "sector", "wpcf-sector" and "wpct-sector", but none of them is good.
I also checked DB, but haven't found the answer.

Thank you!

#1358783
tag_ID.JPG

Hello,

There isn't taxonomy ID, in most case, you can use taxonomy slug, which is unique from other taxonomies.

And each term has it's unique term's ID, you can get the term ID by editing that term, and there is a URL parameter "tag_ID", the value is term's ID. See screenshot tag_ID.jpg

#1358805
Edit Taxonomy_TB_191009.png

Hi,

like I wrote the first I tried was slug "sector" as ID. I also wrote what others I tried.
I tried "wpcf-sector" because this prefix ("wpcf-") works with Toolset created custom fields.
I tried "wpct-" prefix because it might be the possible abbreviation of WP Custom Taxonomy ( supposing "wpcf" means WP Custom Fields )

I don't know where did you create that screenshot, but I have similar at
Toolset / Edit Taxonomy
and its URL looks like:
hidden link
and it doesn't include such tag_IDs.
I attach a screenshot.

Thanks

#1359331

As I mentioned above, there isn't taxonomy ID.

In your case, you can find the term ID by this:
Dashboard-> Brands-> Brand sectors
Edit any one of the term, you will see the URL parameter "tag_ID", it is term's ID.

More help:
https://codex.wordpress.org/Function_Reference/get_term#Return_Values
term_id (int)

#1359417

Well, it is an integer and therefore it can not be used by 3rd party plugin.
I tried it in both versions: 17 and "17"
I'm honestly very disappointed again.
Multiple time I face with it: the concept of Toolset development is not consistent ( in some cases like for custom fields the entity ID is available and can be used by 3rd party in some cases, like this one it isn't ).
I again wasted hours of work hours and days of project time and I must find a new solution outside of Toolset...

#1359421

I think there are some misunderstandings, the term's ID is a WordPress built-in feature, for example, you can find it in your website database, table "wp_terms", column "term_id", if your 3rd party plugin does not support term's ID, you will need to check it with 3rd party plugin author for it.

More help:
https://codex.wordpress.org/Database_Description#Table:_wp_terms

#1359449

Well, I bought Toolset because I wanted to extend WP's core CPT, CF, CT etc. functionalities.
I also know I can manage 3rd party entities inside Toolset if I wish.
So if I create a custom field (CF) with Toolset, which has a string as ID and which can be used inside or outside of Toolset, then I might rightfully think the same concept exist for CT ( so if I create a custom taxonomy (CT) with Toolset, then the dev team of Toolset added the same feature, extending WP core functionality ).
That's what I named inconsistency in dev concept.
I don't want to keep sharing my detailed opinion here,
thank you for your help, we can close the ticket.

#1359451

Thank you!