Git Product home page Git Product logo

Comments (14)

rolandalla avatar rolandalla commented on July 4, 2024 1

Hi @airesvsg .
Version 5.3.8.1 Pro Version
Thanks

from acf-to-rest-api-example.

rolandalla avatar rolandalla commented on July 4, 2024 1

Thank you , Is all right now . Thanks for your work
Best regards

from acf-to-rest-api-example.

airesvsg avatar airesvsg commented on July 4, 2024

Hi @roladn,
please, read the documentation about authentication
http://v2.wp-api.org/guide/authentication/
Thanks

from acf-to-rest-api-example.

rolandalla avatar rolandalla commented on July 4, 2024

Thanks For Reply , The authentication is all right ,I'm authenticated but the only one problem i have is to update the ACF options field.
Thanks

from acf-to-rest-api-example.

rolandalla avatar rolandalla commented on July 4, 2024

image

I'm testing this using postman and nothing is happening.

Something is not correct , or I'm not sending the correct parameter to the PUT request .

Please check this

from acf-to-rest-api-example.

airesvsg avatar airesvsg commented on July 4, 2024

Hi @roladn,
what's the version of your ACF?
Thanks

from acf-to-rest-api-example.

airesvsg avatar airesvsg commented on July 4, 2024

Hi @roladn,
please put this snippet in your functions.php

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';
    }

    return $item;
});

Thanks

from acf-to-rest-api-example.

rolandalla avatar rolandalla commented on July 4, 2024

Hello , everything is ok with this solution , but there is another bug coming by this functions .
The acf field for options now are showed in every post type .
image

This must be only at theme options

Thank you

from acf-to-rest-api-example.

rolandalla avatar rolandalla commented on July 4, 2024

As i checked this function :
add_filter( 'acf/location/rule_match/options_page', function(){
return true;
} );
is returning true in every post type

from acf-to-rest-api-example.

 avatar commented on July 4, 2024

Hi, Could you help me in editing a notes field of acf. Here is the response which I have when called this http://test.localhost/wp-json/acf/v2/user/279 using the method GET
{
"acf": {
"notes": [
{
"note": "test test",
"user_id": "3",
"col1": null,
"user_name": "siteadmin",
"col2": null,
"created_at": "08/05/2016 09:08:55 am",
"col3": null,
"modified": "08/05/2016 09:09:39 am"
},
{
"note": "test2 test2",
"user_id": "3",
"col1": null,
"user_name": "siteadmin",
"col2": null,
"created_at": "08/05/2016 09:08:55 am",
"col3": null,
"modified": "08/05/2016 09:09:40 am"
}
]

I would like to add another notes. I tried with PUT method and it says
{
"code": "cant_update_item",
"message": "Cannot update item",
"data": {
"status": 500
}
}

I have tried via postman.Its would be great if you could help me on this.

from acf-to-rest-api-example.

rolandalla avatar rolandalla commented on July 4, 2024

from acf-to-rest-api-example.

 avatar commented on July 4, 2024

Yes, I tried with Basic Auth authentication

from acf-to-rest-api-example.

rolandalla avatar rolandalla commented on July 4, 2024

`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';
}

return $item;

}); `

Did you ad this snippet at your function.php

from acf-to-rest-api-example.

 avatar commented on July 4, 2024

As I need to edit on my user custom field I provided like this in function.php
add_filter( 'acf/location/rule_match/user', function(){
return true;
} );
But nothing worked out

from acf-to-rest-api-example.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.