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?
- Custom post types filtered by taxonomy using REST API v2
- importing third party json feed as custom post type [closed]
- 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
- WP Rest API Querying Custom Posts by ACF fields
- How to force Authentication on REST API for Password protected page using custom table and fetch() without Plugin
- How to get dynamically custom post type that are under a certain category
- Rest Api v2 orderby meta_key in custom post type
- Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template
- wp_update_post on specific custom post type
- How to add custom fields to admin UI and REST API response?
- WordPress Rest API only returns content when posttype has editor capability
- 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
- Custom Post Type and API REST is not working
- Add custom post type to Backbone collections
- React post to WordPress custom post type
- 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
- 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
- Posts are duplicating on wp_post_update
- 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
- Callback to custom field is not working in WordPress REST API
- Custom Post Type not showing in Rest API on Multisite
- 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
- Post author for revision not being set on update/insert
- How to get all post of custom post type by rest api?
- WordPress API for custom post types returns rest_no_route
- Using wp_localize_script to get data from cpt and pass it to maplace-js locations
- Programmatically change post visibility on save_post action return a 500
- set_query_params using custom params defined in functions file?
- Why does wp_update_post causes white screen?
- Update post if exist from PHP
- 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?
- Run shortcode in custom script in wp_head if post type is CPT ‘Jobs’
- wp-json API: not logged in when clicking link to the API from admin mode
- How to keep a record of changes to a custom field?
- How to make an API call to a custom post type but filtering by meta value?
- Fetching custom post type without knowing post type (REST API)
- 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 To Read Read Custom Post Type Data in Headless CMS Mode
- Create/populate Custom Posts ACF fields from external JSON file
- WP_Query: how to search tags in addition to a custom post type?
- 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?
- 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
- Get Custom Post types data from the API
- How to display “META” array in register_taxonomy
- 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 []
- Populating Custom Fields from live JSON
- 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?
- filter rest api post by a acf filed
- How to properly set a value to meta fields of a custom post type in WP-API/node-wpapi REST API?
- save_post affect creation and deletion
- Convert Custom Post Data to Javascript Array for Autocomplete
- Can I override the permalink/slug on creation
- Custom Post save causes 500 error
- How to dynamically register custom post type
- Store custom post type with JSON content
- querying to custom field over ACF REST API
- 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?
- Custom post type REST api 404: Updating failed. No route was found matching the URL and request method
- upload image with rest API to the media library
- Can’t expose custom field to REST API
- Appointment booking system in WordPress
- rest_api_init is not getting invoked inside a Class
- REST API callback function is not called
- How to add a post page from a button without reloading
- Ajax load more post button not showing
- Can’t retrieve custom post type taxonomy term to custom post type editor
- ACF – Updating all posts of CPT when a custom field from options page is updated