-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help With Post Data #14
Comments
Hi @alexjuniodev, Please, read more about authentication. https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/ Thanks |
@airesvsg I've already read this. Actually, I read all the issues on this project. I'm passing the nonce with
Do you have another guess? I'm struggling last days with it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WP version: 4.9.8
ACF version: 5.7.2
Could someone, please, help me?
I've tried for days update custom fields but I'm getting the following error:
Console Log:
jquery.js:9600 POST http://vendedor-confiavel.local/wp-json/acf/v3/vendedor/128 500 (Internal Server Error)
send @ jquery.js:9600
ajax @ jquery.js:9206
updateProfile @ LoginScreenForm.js:51
dispatch @ jquery.js:5183
elemData.handle @ jquery.js:4991
I've also installed the Basic Auth plugin.
If I replace the url with http://vendedor-confiavel.local/wp-json/wp/v2/vendedor/128 only the title is updated, not the field "whatsapp".
Console Log:
http://vendedor-confiavel.local/wp-json/wp/v2/vendedor/128
LoginScreenForm.js:61 {id: 128, date: "2018-08-24T01:28:09", date_gmt: "2018-08-24T01:28:09", guid: {…}, modified: "2018-08-28T15:32:15", …}acf: facebook: nullwhatsapp: null__proto__: Objectcontent: {raw: "", rendered: "", protected: false}date: "2018-08-24T01:28:09"date_gmt: "2018-08-24T01:28:09"guid: {rendered: "http://vendedor-confiavel.local/vendedor/128/", raw: "http://vendedor-confiavel.local/vendedor/128/"}id: 128link: "http://vendedor-confiavel.local/vendedor/128/"modified: "2018-08-28T15:32:15"modified_gmt: "2018-08-28T15:32:15"password: ""slug: "128"status: "publish"template: ""title: {raw: "Alex Silva", rendered: "Alex Silva"}type: "vendedor"_links: {self: Array(1), collection: Array(1), about: Array(1), wp:attachment: Array(1), wp:action-publish: Array(1), …}proto: Object
LoginScreenForm.js:62 Updated
Code:
my.js
class LoginScreenForm{
constructor(){
this.events();
}
}
functions.php
// Enable the option show in rest
add_filter( 'acf/rest_api/field_settings/show_in_rest', '__return_true' );
// Enable the option edit in rest
add_filter( 'acf/rest_api/field_settings/edit_in_rest', '__return_true' );
add_filter( 'acf/rest_api/item_permissions/get', function( $permission ) {
return current_user_can( 'edit_posts' );
} );
add_filter( 'acf/location/rule_match/options_page', function(){
return true;
} );
add_filter( 'acf/rest_api/option/prepare_item', function( $item ){
if ( isset( $item['id'] ) ) {
$item['id'] = 'options';
}
});
The text was updated successfully, but these errors were encountered: