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:
- Add category base to url in custom post type/taxonomy
- Display all posts in a custom post type, grouped by a custom taxonomy
- What are the differences between custom post type and custom page templates?
- Ordering Posts List By Taxonomy Terms?
- Templates for Custom Post Types and Custom Taxonomies
- WordPress Custom Post Type Category Page
- post count is wrong when using same taxonomy for 2 different CPT
- Issues when rewrite rules collide?
- Add links to post categories and taxonomies in wysiwyg link modal?
- Query multiple taxonomy in Custom Post Type
- Archive page for taxonomy of custom post type
- CPT tax slug conflict with post type slug
- Custom post type archive with dynamic taxonomy filtering – is it possible
- Multiple Archive Pages for Custom Post Types AND Taxonomies
- Custom Taxonomy Breadcrumb Navigation
- Remove “-2” from a Toolset Types URL with the same post name
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- Exclude current post when getting related post on custom post type and taxonomy
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Ordering Custom Post Types with WP_Query
- Is it possible to make tag archive page specific to Custom Post Type?
- Multiple portfolios with one custom post type?
- Custom Post Type and Taxonomy combination
- Custom post types, taxonomies, and permalinks
- How can I display my custom metaboxes on a custom post template?
- How to specify URLS for custom posts & taxonomies
- Taxonomy.php Not Showing Posts
- How to check the terms in single custom post type template
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Posts from all the categories are being displayed instead of particular category
- Categories sorting
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Allow user to set custom order to a list of custom taxonomies?
- Disable block with taxonomies at post page
- search also in taxonomy, tags and custom fields
- Custom Post Types, URL rewrite on multiple CPTs
- redirecting improperly after updating custom taxonomy term when referring from CPT edit page
- Sort and filter custom post type posts by custom taxonomy
- Terms showing up in object cache on unrelated pages
- Hierarchical permalinks for custom post type and taxonomy
- Custom post type pagination 404
- Best way to specify “article type” in URL
- List Posts By Custom Taxonomy
- Dynamically insert an article at the top of a taxonomy archive – or?
- Many to many to many custom post relationships
- Iterating through Object Array to customise display of full custom taxonomy for custom post type
- WordPress multisite – is it possible to have different taxonomies for each site?
- How to filter a custom post type by custom taxonomy without 404
- When I choose category from dropdown then everything working fine.But in backend it checked only child not parent [closed]
- How to show list of taxonomy terms associated with specific post?
- Custom Columns for Custom Post Type Manager
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- Group Custom post type in a taxonomy page by its child taxomony
- Get child categories of custom taxonomy category?
- Display Taxonomy Term Children in a Drop Down without Submit Button
- Custom taxonomy query showing more than 4 posts
- Check category_name or taxonomy slug for a Custom Post Type?
- Help on Custom Post Types
- What is the most efficient way to execute recursive complex queries?
- 2 custom post type paging in 1 custom taxonomy
- How to display post from one custom post type in another custom post type with the same taxonomy?
- how to achieve this permalink abc.com/CPTName/CustomPostTypeCategorySlug/categoryname
- How to display list of custom post taxonomy terms and their posts (if any)?
- have to do a while have post to show for two custom post types sharing the same taxonomy?
- Remove custom permalink base from CPT custom category and custom tags
- How to handle this wordpress custom post type rewrite problem?
- List taxonomies by post id
- How do i display all categories of a custom post type and have respective page for them?
- Is it possible to arrange Custom Post Types from CPTUI into a Folder?
- WooCommerce – Custom related product (Spareparts)
- Insert custom taxonomy into category query
- Issue with Custom Post Types and Permalinks
- Automatically Add a default category to a Custom Post Type before save_post action
- Add active class to foundation 6 tabs while looping categories
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Get list of all Topics in use by a custom post type
- Custom post types with child taxonomy not visible in admin
- 404 error next-page [2] PageNavi custom type taxonomy
- Custom taxonomy archive slug overwrites static page
- Slugs on hierarchical taxonomies
- Filter By Term Not Working – Custom Post Type
- Custom post type category archive URL redirects to home page
- How to display category wise posts on seprarate template
- Organizing The Custom Post Type with Taxonomies / Parent Posts
- show custom taxonomies in hierarchy
- Display 2nd category, only once, as sub-heading, in the loop
- Fetch posts list from fist CPT taxonomy term and list under 2. CPT
- Display Custom Post Type in Custom Taxonomy URL
- how to limit query_post to first page?
- How to query the content of a specific custom post type?
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Listing custom post type items from a couple of custom taxonomies
- Catergory args causing loop not to show
- List custom taxonomy terms
- How to pull a number posts from a specific Taxonomy within a Custom Post type
- How to Create Short Code Using Custom Post type
- From form submission values – dynamically update CPT “has_archive” slug and custom taxonomy “rewrite” slug value
- Problem with shortcode