$taxonomy = 'training_cats';
$orderby = 'name';
$show_count = 0; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 0; // 1 for yes, 0 for no
$title="";
$empty = 0;
$args = array(
'name' => $taxonomy,
'orderby' => $orderby,
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => $hierarchical,
'title_li' => $title,
'hide_empty' => $empty
);
$cats = get_taxonomies($args);
foreach ( $cats as $cats2 ) {
echo '<input type="checkbox" name="checkbox_id" value="'.$cats2->name.'" />';
echo $cats2-name;
}
Not tested but should work, change the taxonomy name etc 🙂
Edit: Try the new code, using get_taxonomies (the code didn’t know where to pull data from)
Edit2: Changed taxonomy to name:
Related Posts:
- Modify output of wp_dropdown_categories to add term IDs to each option
- How to make HTML select options searchable
- Create multidimensional array of taxonomies
- How to show a hierarchical terms list?
- The Difference Between Hierarchical and Non-Hierarchical Taxonomies?
- How to perform unit testing on proposed patches in Trac?
- Attaching taxonomy data to post with wp_insert_post
- Need a simple but complete example of adding metabox to taxonomy
- How to get taxonomy term of the current page and populate queries in the template
- Can the default “post tags” taxonomy be renamed?
- Custom columns for taxonomy list table
- Custom Taxonomy WP_Query for All Terms in a Taxonomy?
- Custom taxonomy list page?
- How to add a default item to a custom taxonomy?
- Remove the category/taxonomy description field?
- Add ‘Description’ to taxonomy ‘Quick Edit’
- Why does get_term() require taxonomy? Are term_ids not unique?
- How does Woocommerce store variation attributes, and how can they be retrieved per-variation? [closed]
- tax_query in get_posts() not working?
- What is wp_insert_term “alias_of” arg for?
- Automatically Assign Parent Terms When A Child Term is Selected
- get term by id without taxonomy
- How to organize and cache additional data associated with terms?
- Using pre_get_posts to set posts per page, how do I?
- get a specific taxonomy term name
- wp_set_object_terms() Fails to Set Terms
- wp_set_object_terms() — prevent overwrite?
- Taxonomy terms sort by… Last name!
- List Hierarchical Term List with Count with Related Term
- Is there a way to set singular/plural labels for taxonomy term names?
- WordPress – Creating multiple versions of the same single-customtype.php depending on selected taxonomy categories
- Better way to enforce category hierarchy in post_categories_metabox?
- get_terms() How many is TOO many?
- Exclude custom taxonomy from search results and archive pages
- Child Terms not Displaying on the Taxonomy Term Admin Screen
- get_terms with posts that have a different taxonomy with term x
- How to display child term of current term’s parent taxonomy?
- List all taxonomy terms / Show links if posts are attached, else names
- List taxonomy terms as links
- check if tag exists in wp database
- Sorting custom taxonomy causes menus error
- How to overwrite a specific parameter in a core taxonomy?
- Set a cookie in WordPress, using a select form and Jquery
- How to add terms to taxonomy with wp_insert_terms?
- How to update taxonomy custom field with wp_update_term()?
- Get_term_by only returns one item from array
- How to set a Preset category for custom post types?
- Can we have same term slug in different taxonomies?
- Is there any difference between post in child term and child & parent terms?
- Add additional data to a specific taxonomy term when used in a post
- Set default (auto) slug prefix for Tags
- How to have “the most used tags” taxonomy always expanded?
- Add Thumbnail to wp_list_categories()
- Get parent and first child taxonomy terms?
- How to add automatically keyword to taxonomies when a post published, and assign them to the post
- Display the number of published posts for each custom taxonomy term?
- Display Custom Taxonomy in Sidebar in Two Columns
- Get wordpress taxonomy archive and sort by year
- Search for tags
- Create and move terms for taxonomies
- Display Post by taxonomy and taxonomy child
- Display Post by taxonomy and taxonomy child if exist
- Fatal error: Call to undefined method stdClass::filter() in wp-includes\taxonomy.php on line 805
- WP native tag suggest metabox. How does it process tag id?
- Missing term_id and term_taxonomy_id when adding a term using wp_insert_term() function
- Update all posts at once
- Change order of WordPress tag cloud
- Retrieve taxonomy terms in order of their post’s date?
- How to get the last term from taxonomy?
- Count posts for each taxonomy term for each month
- Custom taxonomy archive – No posts found [closed]
- Display parent taxonomy name and list child taxonomies below it?
- List post from current taxonomy children
- What hooks/filters are there to alter selected terms on post save?
- Count argument in get_terms has no effect on ouput/doesn’t work
- Filter blog archive by category in URL
- How can I remove links from the function “get term list”?
- Alphabetical order in taxonomy.php
- Get Term names from WP Term Object
- tax_query: What to pass when I want to have all terms?
- Custom Roll/Custom Post Type – Can’t Select Categories
- Let users create a new custom taxonomy entry from frontend (without creating a post)
- Get the term for an taxonomy archive when the term has no posts
- Trying to list terms of a custom taxonomy using get_categories
- Add a term to an attachment submitted from front end
- orphaned taxonomy terms remove by sql query
- functions to create term and child terms
- Get and loop posts with all taxonomy terms
- Unable to delete a Category and Tag that share same slug
- base directories / URL
- Get current custom user taxonomy
- Conditional tag affecting taxonomy term and its children?
- WordPress REST get all items without a taxonomy assigned
- Custom template for archive of a custom taxonomy
- has_term not working
- taxonomy/category term in URL slug irrelevant for post?
- Filter taxonomy terms using multiple id in the edit-tags.php
- Getting the parent from the wp_term_taxonomy
- Organising Taxonomy categories
- How to use a Term Meta Field as a link