GithubHelp home page GithubHelp logo

Comments (4)

benvoynick avatar benvoynick commented on June 16, 2024 2

I've committed 946bc90 to resolve this and related issues.

As @paulmist noted in #4 the nesting level for the subfield loop was not right, and so a lot of subfields were potentially getting missed.

The warning was caused because acf_get_fields() requires a WordPress post ID (which anything below the Field Group level does not have). Thankfully it is not necessary to call that function on the individual layouts: while acf_get_field_groups() does not populate field data, acf_get_fields() does return recursive field group data.

I've refactored the code to split the recursive portion out into another method that calls itself, which I think makes things a little easier to read. It also means that even deeper nesting levels are supported. While going deeper probably wouldn't be a good user experience, the plugin will allow it for anyone who wants. :)

from acf-flexible-content-preview.

jameelmoses avatar jameelmoses commented on June 16, 2024

Thanks, @benvoynick. @paulmist this is now resolved and released. Thanks for reporting!

from acf-flexible-content-preview.

paulmist avatar paulmist commented on June 16, 2024

@benvoynick brilliant! Thank you for tidying up my mess.

Perhaps you can have a stab at Covid19 next?

I was looking for some good documentation on the ACF functions but struggled.

from acf-flexible-content-preview.

jameelmoses avatar jameelmoses commented on June 16, 2024

@paulmist while you’re here, check out https://github.com/jameelmoses/acf-flexible-content-extended. It provides the same functionality for image previews of layouts with the added improved UX of editing layouts in a modal so your backend pages aren’t so long

from acf-flexible-content-preview.

Related Issues (10)

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.