GithubHelp home page GithubHelp logo

acf-to-rest-api-recursive's People

Contributors

airesvsg avatar joshuafredrickson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

acf-to-rest-api-recursive's Issues

after_theme_setup hook not working

Hi, thanks for writing this! I don't know why, but in plugin.php I had to change the after_theme_setup hook to wp_loaded to get it to work. Otherwise, it works great! Any insights on why this is?

Recursive with custom post types

Hi,
I can't make it work as I need and I don't understand if I do it wrong or simply it is not possible.

I have two custom post types: "menus" and "dishes";

Eash dish has a few fields, say "dish name (post title)", "dish price", "dish description";

I want to create dishes and associate them to menus via relationship field.

Example:
MENU 1
dish 2, dish 4, dish 7

MENU 2
dish 1, dish 6, dish 11

If i call menu 1 via rest with url .../wp-json/acf/v3/custom_menu/1
I get dish names (which are post titles) but can't get post acf fields.

The same happens if I call .../wp-json/wp/v2/custom_menu/8, slightly different response but no acf fields.

I tried registering post types with Custom Post Types UI, Types, via code, but none of those makes any difference.

Thank you

Post object taxonomy not showing

I am trying to render post object taxonomy term as API but it doesn't show for me other all the information showing like featured image, title and default fields.

image
image

How do I filter by a property in an ACF group?

Hi

This plugin seems very neat but i'm having trouble find examples of what I want to achieve. Please can you point me in the right direction.

I'd like to filter all packages with a max price http://localhost/wp-json/acf/v3/packages?max_price=1001

The json is as follows

[{
      "id": 1,
      "acf": {
        "packages": {
          "title": "I am a doge",
          "price": "1000",
        }
      }
    }]

And my the code

add_filter( 'rest_query_vars', function ( $valid_vars ) {
    return array_merge( $valid_vars, array( 'max_price', 'meta_query' ) );
} );

add_filter( 'rest_packages_query', function( $args, $request ) {
// missing code
);

Featured Image

Hello,

Is there anyway to add the featured image url of the ACF object / relationship post field ?

Thanks :)

API Endpoints

Is it possible to go even deeper than /wp-json/acf/v3/{taxonomy}/{id}/{field-name}?
I'm looking for /wp-json/acf/v3/{taxonomy}/{id}/{field-name}/{id}

Need to handle infinite loops

Hi, thanks for this plugin - it's simple and super helpful.

One thing I noticed is that if an admin on a WP site using this plugin accidentally adds an ACF Relationship field to the same post that they are working with, the REST API response breaks and runs into an infinite loop situation.

Should be a similar fix I'd imagine to make sure that this is avoided. If I have time I will try to crack in and make a pull request. In the meantime I thought I'd let you know!

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.