I think you need an update_callback in register_rest_field(). Please note that I haven’t tested this.
add_action( 'rest_api_init', 'slug_register_meta' );
function slug_register_meta() {
register_rest_field( 'place',
'meta',
array(
'get_callback' => 'slug_get_meta',
'update_callback' => 'slug_update_meta',
'schema' => null,
)
);
}
function slug_get_meta( $object, $field_name, $request ) {
return get_term_meta( $object[ 'id' ] );
}
function slug_update_meta($value, $object, $field_name){
// please note: make sure that $object is indeed and object or array
return update_post_meta($object['id'], $field_name, $value);
}
Related Posts:
- Add custom taxonomy fields when creating a new taxonomy
- Display sub-taxonomies based on SELECTED parent-taxonomy
- How to get all the terms from a custom hierarchical taxonomy via REST api?
- How to add images to taxonomies?
- Can you add the visual editor to the description field for custom taxonomies?
- Check if a post has any term in this custom taxonomy?
- WP REST API no longer supports filter param, so how do I get posts in a custom taxonomy?
- Custom taxonomy hide meta box but show in menu
- display posts with same taxonomy term
- Is there a way to disable a term rather than deleting it?
- Modify Term Update Redirection
- Check if current term is a child of another term
- get_terms() doesn’t return empty terms even though hide_empty is false
- SQL QUERY needed to get POST category (taxonomy) ? – MUST be SQL statement
- Remove Category description textarea
- Archive template for taxonomy terms
- How can I set up a category “overview” page?
- Sort posts by number of matched terms
- Possible to register multiple custom taxonomies in one function?
- Taxonomies not appearing in columns on dashboard
- Echo taxonomy term meta on author.php
- Hierarchical display of custom taxonomy
- How to output the taxonomy term name in a widget
- Advanced Tax Query
- Function to limit the number of posts in taxonomy.php
- Is It Possible To Have Shared WordPress Custom Post Types?
- WordPress renames slug of tags used in multiple taxonomies?
- User role permissions based on taxonomies
- WP Query with custom taxonomy
- How to prevent posts duplicating when viewing a custom taxonomy term
- get_the_terms() to show all custom taxonomies
- Custom taxonomies making WP very slow – Way to fix?
- Get Taxonmy Term ID For Current Post
- meta_key & meta_value not working with get_pages and custom taxonomy
- Is it possible to create exclusive custom taxonomy?
- wp_insert_post not updating custom taxonomy selected if logged in as a subscriber
- Changing stylesheet depending on custom taxonomy terms
- Taxonomy with_front causes all
- Taxonomy archive showing no results
- Autogenerate Front End Form Field With jQuery
- Changing taxonomy term by slug (wp_update_term)
- Taxonomy template shows only 10 posts
- Rewrite Rule Working for all but one of the taxonomies created
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- How to Rewrite Taxonomy URL to Include the Post Type as the Second Segment of the URL?
- How to get all taxonomies which can be added in menu?
- WordPress Tag or Custom Taxonomy Return All Posts if has that Word in Post Title
- woocommerce custom product category template
- Custom Taxonomy index/archive hierarchy
- Failure to add term meta
- Filter custom taxonomy archive posts by 2nd custom taxonomy using select dropdown
- How to show all post related taxonomies
- Create custom taxonomy and Display in metabox dropdown
- Custom Taxonomy with tax_query
- Override Taxonomy Template
- Get posts in certain Taxonomy terms for the current page url
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Edit custom taxonomy description programatically
- Get taxonomy name for the current post
- View the complete list of a taxonomy in the navigation menu
- Getting taxonomies associated with a specified post type
- Get name of taxonomies of current page
- Filter through custom taxonomy with an array of taxonomy IDs
- Add custom taxonomy as a css class
- Taxonomy page shows category in title
- Query custom taxonomy for category including children
- Taxonomy Overview Page?
- Order taxonomy terms wordpress
- Only display latest custom taxonomy post
- Unable to get the Parent Custom Taxonomy Terms
- Unsetting post_tag taxonomy breaks term description for other taxonomies
- Taxonomies on Pages with Custom Formatting
- How to combine taxonomies into URL?
- Why do my quick edits for custom taxonomies not show on the post frontend?
- Terms added to custom taxonomy for custom post type only appear in Rest when added in code
- WordPress REST API – get custom taxonomy category posts
- Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
- Tracking the name of a custom taxonomy
- Add terms to a taxonomy archive from within the same taxonomy
- Show recent posts from a custom taxonomy in wordpress
- Fill New Taxonomies
- how do you pull data from two taxonomies?
- problem : Custom taxonomy template not showing
- Filter “get_terms” query
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- generate random slug when adding taxonomy
- how to filter the data’s comparison operators (>= &
- Sort Taxonomy List by Custom Values
- How to display custom taxonomy
- Taxonomy term breadcrumb; how?
- Using wp_query is it possible to orderby taxonomy?
- Custom Taxonomy Template Variables Available?
- Group custom taxonomies based on tags contained in their posts
- Make custom post type display with custom taxonomy in url
- Prevent random entries in hierarchical false taxonomies
- Exporting CSV of users with custom user taxonomies out of WordPress
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post
- Querying posts globally based on custom taxonomy with its own taxonomymeta table
- How to delete unused terms?
- Child terms with improper parent in the url should redirect to 404