I am echoing the “procedures” term I expect to get this meta field
get_term()
returns a WP_Term
object which by default does not include any metadata, even for registered meta keys.
So registering a meta key does not automatically add it to the term object, but registering a meta key has 2 main benefits:
-
You can set a default value for the meta, which is returned when you call
get_metadata()
orget_term_meta()
, see thedefault
argument here. -
You can make the meta be accessible via the REST API, via the
show_in_rest
argument (see the same link above).
So for example, if you set default
to 1234 and show_in_rest
to true
, then a request for a taxonomy’s collection in the REST API (e.g. at /wp-json/wp/v2/procedures
) would contain a "meta":{"source_post_id":1234}
in the JSON response, for terms without that meta.
Related Posts:
- Render custom taxonomy query as single template
- Custom meta-box for all custom post types
- Custom Taxonomy Query by Taxonomny not working
- WordPress: insert a custom post type instance as an option for a custom taxonomy
- Fetch posts list from fist CPT taxonomy term and list under 2. CPT
- How to solve performance issue caused by custom post type overview with 20k+ custom taxonomy terms
- Single page archive – get coresponding taxonomy and terms
- How to assign custom post template to its custom taxonomy terms
- Excluding top level from taxonomy and post loop
- Prevent repetitive terms in get_the_term_list
- Trouble showing showing Posts related to custom post type and taxonomy.
- One custom post type with two different url structure base on taxonomy term
- How to query posts by meta keys AND under specific category?
- Displaying posts exclusively in their category (not parent)
- Loop multiple taxonomy in custom post
- Shortcode display CPT Query only showing 1 post?
- wp_query: How to retrieve current term slug in custom taxonomy?
- Get custom taxonomy name from custom post
- Custom taxonomy archive is visible to only subscibed users
- Post Editor: display categories from current post type taxonomy only?
- Custom Post Type and Custom Taxonomy not connected
- tax_query showing no results
- Add different meta box based on taxonomy
- List all posts from custom post type by taxonomy
- Permalinks when using Custom Post Type with static page for archive
- How to List CPTs Under One Tax Term
- How to change permalinks to taxonomy and post type’s posts
- Generating List of Tags from Custom Post Type
- predefined custom field on registration page
- Post data in separate divs with incrementing class using WP_Query
- Displaying taxonomy icon outside archive page
- Why won’t this rewrite rule work?
- archive-{custom_post_type}.php not getting recognized wordpress
- Paginate custom taxonomy category with wp_custom_pagination
- Archive.php is not displaying tags
- How to retrieve the permalink for a specific (custom) term?
- Values inside a custom field to determine which category posts to display
- Custom post type post taxonomies
- Custom Taxonomy List, Selection floats to top
- Custom post type – two taxonomies
- Exclude Custom Post Type from shared Custom Taxonomy
- Get custom post type where taxonomy..
- If taxonomy show class of active
- Connecting multiple post types? Or linking “News” posts with “Game” posts how?
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Show Custom Post Type taxonomy term that matches custom field
- Querying multiple taxonomies in URL leads to wrong taxonomy archive
- Sort by Custom Post Type (Multiple Loop)
- Costum post type with costum (sub)taxonomy
- WordPress Custom Post Type and sort by Tags
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Linking custom taxonomies and posts
- Archive templates based on taxonomies
- taxonomy term names in custom post type permalink structure
- Displaying custom post types with taxonomy
- Show taxonomies from specific CPT
- Query Posts with Custom Taxonomy from a Custom Post Type
- Get a list of categories ids
- How to show a custom taxonomy using a custom template
- custom post type and taxonomy URL
- custom post type and taxonomies in a php class
- Adding 2 CPT with multiple custom taxonomies to permalinks
- Get Registered Custom Post Type to get All Custom Taxonomies
- Exclude a custom category from a list
- How to Associate Posts with Pages
- Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
- custom taxonomies are not showing up in get_taxonomies
- Display posts from category in page
- Parent cpt/child custom post type URL permalink relationship
- insert a taxonomy for a custom post type
- Sort a custom post type loop by a custom taxomomy instead of chronologically
- changing post type in loop query
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Get link for feed of specific post type AND taxonomy
- Why is this custom post type defaulting to archive.php?
- Taxonomy and Rewrite Structure
- Changing custom taxonomy’s slug as required?
- Pagination for a Custom Taxonomy
- How to display elements of different post types?
- Trying to create hierarchy between 3-4 custom post types
- Custom Taxonomy Showing in WP Menu
- How to not have the items of the subtaxonomy within the parent taxonomy
- Storing/querying custom date data
- Get term_id for each instance of custom taxonomy
- Custom Template Taxonomy
- Customize category URL
- title tag for custom post type remove taxonomy name from title tag
- Permalink Trouble with Custom Post Type
- Custom Post Type Permalinks Problem
- How to internationalize the sub menu name “categories” in Custom post type?
- Order by custom field attribute
- Display and Allow users to edit their own profiles
- WordPress Custom Permalink Structure with Custom Post Type and Taxonomies
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Show custom taxonomies in admin panel under custom post type
- Remove custom taxonomy ‘post-type’ from post URL
- List a custom taxonomy’s terms, with links, on the taxonomy page
- How to get child taxonomies
- Change Taxonomy Permalinks
- Display Custom Taxonomy of custom post type