Use the ACF field name, not the field key. This works:
update_field('forecast_link', $json_data['properties']['forecast'], $post_id);
update_post_meta($post_id, 'forecast_link', $json_data['properties']['forecast']);
Use array keys to access nested data as needed.
Reference (ACF Docs):
https://www.advancedcustomfields.com/resources/update_field/
Related Posts:
- Fetch All Posts (Including Those Using a Custom Post Type) With WordPress API
- Recommended way to remove WP REST API returned data for custom post
- How to add/edit advanced custom fields on custom post type’s WordPress REST API?
- With Rest V2 (WP4.7) how does one restrict certain RESTFUL verbs?
- Custom post types filtered by taxonomy using REST API v2
- Update CPT meta data using REST API
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- WordPress REST Create Post of Custom Type
- Automatically fill custom field value on post publish/update
- REST API: How can I restrict a custom post type to only be accessible by authenticated users?
- Show custom post type endpoint in REST API just if user has capability
- How to force Authentication on REST API for Password protected page using custom table and fetch() without Plugin
- Get the Category Name instead of ID from WP-API
- Rest Api v2 orderby meta_key in custom post type
- Get custom post type REST API not working
- WordPress Rest API only returns content when posttype has editor capability
- Custom search with Custom Fields in WP REST API?
- Wp Rest API request posts from a custom taxonomy
- wp_update_post based function works on existing posts, but not new posts
- Updating post title using wp_update_post
- Add custom post type to Backbone collections
- How Can I Set the Post Author of a Post I Just Created With PHP?
- Custom Post type with ACF in REST API, how do I get those values?
- is_main_query() not working for WP REST API
- Very simple wordpress block to display posts from an api call
- Add custom parameter to REST API request of a custom post type?
- Custom Taxonomy Invalid in REST API
- How do I get the intended post type of a revision post?
- Using The REST API How To Pull All Custom Posts?
- Insert and then update post_type by wp_update_post
- Cannot add custom field to “orderby” parameter in Rest API
- Expose a custom field of a custom post type to the REST API
- How to create custom post by using REST API securely?
- Custom post type archive page – Posts overview – with one modal for multiple posts?
- WP Rest API – How to get an empty response if query has no posts
- post meta parameter in post custom-post-type endpoint with restapi
- Exclude objects from WordPress API based from ACF field using rest_prepare_{$post_type}
- filter custom post in rest api with custom function
- API Rest Custom Post Type doesn’t return all data
- Custom REST endpoints for a custom post type with custom fields
- How to get all post of custom post type by rest api?
- Create custom post with meta field with AJAX and the WordPress REST API
- How to automatic update date and time when save custom post type
- Using wp_localize_script to get data from cpt and pass it to maplace-js locations
- How to see posts in taxonomy endpoint
- WP API Response does not show my registered metadata
- Update post if exist from PHP
- REST filters only firing when I have a param set
- Custom REST endpoint not working to retrieve single posts (“rest_no_route”)
- How to add a filter to a custom post type to get adjacent custom posts via the REST API
- Getting a GET error in console – 404 not found for wp-json
- How to handle new post from API request?
- wp-json API: not logged in when clicking link to the API from admin mode
- Importing JSON feed giving Notice: Array to string conversion error
- Custom Post Type API doesn’t show taxonomy or category array
- Odd behaviour for the update button when displaying a WP_List_Table
- How to make an API call to a custom post type but filtering by meta value?
- WordPress REST API V2: “{CUSTOM_POST_TYPE} matches Term ID List and Term ID Taxonomy Query, but should match only one.”
- no_rest_route in Unit Testing for REST endpoint for CPT registered via show_in_rest
- How can I create new CustomPostType record using wp.api.collections?
- Custom endpoint filtering post by custom taxonomies
- ForEach Loop iterates only once when inserting product variations
- wp rest api orderby field in a custom table
- Updating a custom post status after an expiry date rather than trashing it
- How can I sort the results of a REST API response by the title of a connected custom post type?
- How to filter a matched value with custom key using WP REST API?
- URL issue retrieving Custom Post Types using Backbone JS API
- How to add field to custom post type endpoint
- Create API’s for custom-post types & custom queries using REST or Graphql
- Action on Custom Post publish
- Publishing failed. The response is not a valid JSON response
- Get Custom Post types data from the API
- How to display “META” array in register_taxonomy
- How can I add a meta[] to my custom post type and search by term with the Rest API?
- register_rest_field update_callback don’t work for $_FILES
- Change the term based on the value of a $variable using wp_update_post in submitting a form
- localize_script or rest api
- Issue with CPT posts within WP REST API showing as []
- Saving custom post types post_meta over REST-API fails
- WP REST API Custom endpoint don’t work in my plugin
- How do I use URL to fetch all posts of a particular custom post type?
- update flamingo_inbound post type after insert
- save_post affect creation and deletion
- WordPress API only returning HTML
- Convert Custom Post Data to Javascript Array for Autocomplete
- Can I override the permalink/slug on creation
- Custom Post save causes 500 error
- Change custom post status to draft before today
- Store custom post type with JSON content
- querying to custom field over ACF REST API
- Create settings page to enable or disable CPT
- Get all posts of any post type in a category from REST API
- Make term slugs of custom taxonomy available in WP REST API for custom post type?
- Can’t expose custom field to REST API
- Appointment booking system in WordPress
- rest_api_init is not getting invoked inside a Class
- Load more post with AJAX
- REST API callback function is not called
- Post current post type to my Ajax
- Can’t retrieve custom post type taxonomy term to custom post type editor