Hi,
I am facing this issue when i add value..
]]>Iam using the “ACF” plugin with “ACF to REST API”. I found a solution for querying a custom field over REST API.
I inserted this into my functions.php:
add_filter( 'rest_{type}_query', function( $args ) {
$args['meta_query'] = array(
array(
'key' => 'my_field',
'value' => esc_sql( $_GET['field'] ),
)
);
return $args;
} );
Url: /wp-json/wp/v2/posts?field=test The wildcard {type} can be: post | user | comment | attachment | custom post type | taxonomy
This solution is not perfect. Once this code snipped is added, the filter works but if you go to /v2/{type} <– which usually lists all, this stops working.
Any solution for that?
]]>Hi Support Team,
We have a site which has Spanish (ES) as default language and English (EN) as secondary language. We are posting the data via API. When we post the data in both ES & EN language it works fine. But when we trying to map the translations, the mapping is created but somehow the ES data (mainly the ACF custom fields of type=”Group”) disappear from the EDIT page! We can see it in the Post Meta Inspecter and Database, but not on the EDIT page. Which is strange! Could you please guide us?
Thanks
IMRIEL
Hello Team,
Trying to insert acf data in post using /wp-json/acf/v3/posts/{id} in Postman but enable to edit as well as insert data.
Even in the setting of ACF, only found “Show in REST API” option was not found or Eidit in REst API option. How to enable it.
Please provide a document on how to add/update/delete data in ACF fields using this POSTMAN tool.
here is the document for reference
https://nimb.ws/9f3uCT
The error that occurred when your site broke was:
Fatal error: require_once(): Failed opening required ‘/srv/htdocs/wp-content/plugins/acf-to-rest-api/v3/class-acf-to-rest-api-v3.php’ (include_path=’.:’) in /srv/htdocs/wp-content/plugins/acf-to-rest-api/class-acf-to-rest-api.php on line 46
And a warning that appears sometimes is:
Warning: require_once(/srv/htdocs/wp-content/plugins/acf-to-rest-api/v3/class-acf-to-rest-api-v3.php): failed to open stream: No such file or directory in /srv/htdocs/wp-content/plugins/acf-to-rest-api/class-acf-to-rest-api.php on line 46
Hey, the ACF to REST API works normal, but the data it resend is empty.
This problem happens to all of our blog site based on wordpress.com
Could help find the real reason behind this problem?
]]>Hey all, Iain the Product Manager for Advanced Custom Fields here ??
As part of the ACF 5.11 release we added native support for ACF fields in the WordPress REST API. Read more about that here.
]]>Hi, we’re considering using this plugin…
Are there plans to maintain it, in the future?
T
]]>Hi, Is It possible to maintain in api rest the position order that the customs fields has in the page?
Always return the custom fields in the api rest response, ordered alphabetically
Thanks!
]]>I’m trying to update a products acf fields using the plugin and an external python code. My endpoint is acf/v3/product/676, and I am trying to post the following:
{‘acf’: {‘finish’: ‘Sanded and Polished’,
‘slice_number’: ’21-001-03′,
‘stamp’: None,
‘weight_ozt’: ‘51.71’}}
I’ve tried posting other things, but always get the response:
{‘code’: ‘rest_forbidden’,
‘data’: {‘status’: 401},
‘message’: ‘Sorry, you are not allowed to do that.’}
I tried modifying the plug in settings to change false to true in the following, which exposed the toggles to allow fields to be seen and edited, but didn’t help.
public static function render_field_settings( $field ) {
if ( apply_filters( 'acf/rest_api/field_settings/show_in_rest', true ) ) {
self::show_in_rest( $field );
}
if ( apply_filters( 'acf/rest_api/field_settings/edit_in_rest', true ) ) {
self::edit_in_rest( $field );
}
}
]]>
Hi,
When i try to edit fields of a user i have the error :
{“code”:”cant_update_item”,”message”:”Cannot update item”,”data”:{“status”:500}}
My endpoint is : wp-json/acf/v3/users/(ID)
I use PUT method.
After few hours I found something really weird that make it works but i can’t use this forever :
I need to put a rule in my ACF configuration like :
OR
USER ACTUEL – IS – CONNECTED
This configuration add all the ACF fields for all elements (post, custom post type…), but let the UPDATE works through the API.
The problem is, i can’t let this fields everywhere. So i need to find a solution
How can i do this ?
Thanks
]]>Hi there,
First, i’d like to thank you for your awesome work on this plugin.
I have an issue when trying to populate a custom field on comments. I’ve added a custom fields “note” with ACF. I am trying to post a comment and set a value to this field, however i’ve tried multiple solutions and can’t make it work.
This is an example of JSON I am trying to POST on : https://mydomain.com/wp-json/wp/v2/comments/5
{
“fields”: {
“note”: “4”
}
}
I have also tried to add a new comment but the custom field doesn’t go through.
Thanks for your help,
]]>Hi guys, I’m wondering how to send ACF user fields correctly via an endpoint. I’m using JWT authentication and I can correctly modify users information (name etc) and any other ACF fields related to custom post type, but when I try to update an ACF custom field attached to a user, nothing seems to work. What I’m missing?
]]>Hi. Can you Update to the current version of WordPress?
]]>Hi, thanks for this great plugin. But there’s one issue when I use this plugin for my client.
My client’s website is open for registration. When a normal user registers the site and redirects to the dashboard. The user will immediately see the donation banner. Users may not know what “{ ACF to REST-API }” meaning but when they see “Make a donation”. They may misunderstand it’s a donation link to my client’s site. I suggest only show this banner to admins or users that have the capability to manage the site.
Thanks!
]]>This is on every page of my dashboard. Thank you for your work on this plugin and I hope you receive some donations to help offset the time you’ve volunteered. Adding this to every page on our dashboards is not the way.
Since your plugin doesn’t have a dedicated settings page of its own, I would suggest either adding this to the plugins action links, or simply to the plugins page itself.
]]>Please, if anyone can point me in the right direction. I wish to upload an image to my ACF image field. I can successfully post to text and number fields but not to the image fields. Sorry, if there is an obvious answer I haven’t found. I am a bit new to it.
let frmData = new FormData();
let imageData = {
status: "publish",
"fields[image]": $("#file")[0].files[0],
};
for (let key in imageData) {
frmData.append(key, imageData[key]);
}
$.ajax({
method: "PATCH",
url: siteData._siteURL + "/house/" + theID,
beforeSend: function (xhr) {
xhr.setRequestHeader("X-WP-Nonce", siteData.nonce);
},
contentType: false,
processData: false,
data: frmData ,
success: function (res) {
console.log(res);
},
error: function (jqXhr, textStatus, error) {
console.log("error happened!");
},
});
]]>
I cant’t UPDATE or POST the customs fields on my WooCommerce products, The options show in rest and edit in rest are enabled and I can see the fields in the GET request with Postman, but when I try to update them, they are ignored.
I update with this JSON format:
{
"fields": {
"pack_quantity": "22",
"continue_selling_out_of_stock": false
}
}
But they don’t change (with PUT or POST), they continue as NULL:
"acf": {
"pack_quantity": null,
"continue_selling_out_of_stock": null
}
Am I missing anything to update or post a custom field for a product?
Any help on this would be much appreciated.
Thanks
]]>IT DOES WORK, SORRY! HAVE CLOSED TICKET.
]]>I am pulling some data from a third-party API into a WP site, and client requested that login credentials for the API are editable in admin. However, if I store them in ACF fields on Options page they will be exposed.
Is there a way to hide a specific field/group or specific options page from REST API? I tried the below, but it ended up hiding all options pages, and I need some of that data to be public.
add_filter( ‘acf/rest_api/option/get_fields’, ‘__return_false’ );
]]>I am not sure there is an endpoint for this, but I have a ACF checkbox field named release_change_date with the options below
q4-2020 : Q4 2020
q3-2020 : Q3 2020
q2-2020 : Q2 2020
q1-2020 : Q1 2020
These option will change over time. Is there anyway to access these values with the ACF API?
thanks
]]>HI, From my API (datbase) I want the folder name to be the post title then the pdf in the folder being links then each time a new pdf is added. A new link is made in the post. Is that possible with this?
Thanks
]]>Thanks for this cool plugin!
But I need help. How can I change the name of “acf” to another in the rest api?
thank you
example:
API REST:
“acf”: {
“avg”: “0”,
“total”: “0”,
I want change “acf”
]]>hi guys does this plugin expose the translated fields that QtranlateXT manages?
https://github.com/qtranslate/qtranslate-xt
it would be amazing but it doesn’t seem to expose te data , not sure who is to blame haha, if is some kind of redirection caused by the translation plugin or yours is not supporting it , but the issue could be probably overcome by creating custom post types for each of the languages, and avoid using the “translation feature” … but it seems that the endpoints are not working when i switch a language… do you any idea of how I could overcome this issue? thanks!! kind regards
I am able to populate a custom field called _affiliate_link in the default post type using:
$.ajax({
url: wpApiSettings.root + 'wp/v2/posts',
method: 'POST',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-WP-Nonce', wpApiSettings.nonce);
},
data: {
'title': 'New Post Title',
'fields': {
'_affiliate_link': 'testing-123'
}
}
}).done(function (response) {
console.log(response);
});
But, I cannot update the same custom field for Products:
$.ajax({
url: wpApiSettings.root + 'wc/v3/products?consumer_key=ck_removed_for_post&consumer_secret=cs_remove_for_post',
method: 'POST',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-WP-Nonce', wpApiSettings.nonce);
},
data: {
'name': 'New Post Title',
'fields': {
'_affiliate_link': 'testing-123'
}
}
}).done(function (response) {
console.log(response);
});
I get this in the response:
acf:
_affiliate_link: null
Am I missing anything to update a custom field for a product?
]]>Hi, This plugin support WPML? I want get translator data in ACF Rest API.
]]>Hi there, I am using the latest version of the plugin (v3.3.1), I can set V2 or V3 of API in the Permalink settings, however when I go to ACF, the “Show in Rest API” and “Edit in Rest API” toggles are not showing. Any idea what I might be doing wrong?
]]>I see the endpoint is /wp-json/acf/v3/options/{id} , but I can’t seem to load any values there. Is {id} meant to be the ID of the ACF field group? I can load an endpoint using that number (or any number…) but the values are empty. Otherwise I’m not sure how to obtain an ID for the actual admin options screen. I’m sure this is something obvious, any pointers would be very welcome.
Thanks!
]]>So the problem is that we are using ACF PRO v5.2.8 which is working fine with our api for the post object sub_field. But when we tried the latest version of ACF PRO v5.8.12 then data isn’t getting saved through the API. Is this plugin not supported with the latest ACF PRO v5.8.12?
Here is an example post link https://bookingagentinfo.com/celebrity/tekashi69/ and API payload structure https://documenter.getpostman.com/view/2877026/bookingagentinfo-api/7159GPZ?version=latest#c93642b7-576a-dd30-62ca-715b24a513fc
]]>Hello,
my name is Dragan Milunovic and am really interested in using your plugin as help for my plugin – Searching for Posts.
Right now I am making pro version of my plugin and asking you as the author: is it allowed for me to recommend using your plugin as part of my plugin for making a better searching of Advanced Custom Fields.
]]>