admin管理员组

文章数量:1287524

For a site I need to show related posts for a custom taxonomy. Because another person build this site and also created a custom taxonomy, and this code can't be found in a proper file like functions.php or a plugin, I need to track this name so I can use it for other code solutions.

For clarity; If I create a custom taxonomy, a part of the code is

register_taxonomy('**SUBJECT TO TRACK**',array('customposttype'), array(

I need to track the part of 'SUBJECT TO TRACK'. Is there any function I could use to show this on a page? probably the answer is simple, but i can't find it anywhere...

For a site I need to show related posts for a custom taxonomy. Because another person build this site and also created a custom taxonomy, and this code can't be found in a proper file like functions.php or a plugin, I need to track this name so I can use it for other code solutions.

For clarity; If I create a custom taxonomy, a part of the code is

register_taxonomy('**SUBJECT TO TRACK**',array('customposttype'), array(

I need to track the part of 'SUBJECT TO TRACK'. Is there any function I could use to show this on a page? probably the answer is simple, but i can't find it anywhere...

Share Improve this question asked Sep 21, 2021 at 15:09 RicardioRicardio 381 silver badge8 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

After messing with some code I found a solution: just use this code and a lot if information will be showed. Within all this data you search for the categorie that is inside your taxonomy and you'll see the taxonomy-> name.

// Show all data of all taxonomies
function print_tax_data(){
    $data = get_terms();
    print_r($data);
}
add_shortcode('tax_data', 'print_tax_data');

本文标签: Tracking the name of a custom taxonomy