Git Product home page Git Product logo

Comments (11)

MarieComet avatar MarieComet commented on August 14, 2024 1

Hi @rafegoldberg
I think it's the same issue that #8 which I can't resolve for now.

from mc-acf-flexible-template.

MarieComet avatar MarieComet commented on August 14, 2024 1

Hi @julesrenaud, do you think you can make a pull request for this fix ?

from mc-acf-flexible-template.

julesrenaud avatar julesrenaud commented on August 14, 2024 1

@MarieComet certainly, will do. Would you mind if I were to also do a second one which makes it optional to register the acf_template_tax taxonomy? It can be confusing for the user to see "Uncategorized" in the UI.

from mc-acf-flexible-template.

julesrenaud avatar julesrenaud commented on August 14, 2024 1

@PseudoPsychosis I believe so. I think the solution I'm working on will fix both issues. I will post a PR soon.

from mc-acf-flexible-template.

rafegoldberg avatar rafegoldberg commented on August 14, 2024

I gotchya. In any case, let me say again that this is an awesome plugin! It addresses a sorely missed functionality in ACF's core. Very cool.

from mc-acf-flexible-template.

julesrenaud avatar julesrenaud commented on August 14, 2024

Adding the following code block after line 351 in mc-acf-flexible-template.php fixes the issue for flexible fields that are inside a clone field. It doesn't fix #8, but it could also be fixed easily in similar fashion.

if ( ! $fields && ! empty( $_POST['acf'] ) && is_array( $_POST['acf'] ) ) {
    foreach ( $_POST['acf'] as $field ) {
        if ( ! is_array( $field ) )
            continue;

        foreach ( $field as $key => $value ) {
            $length = strlen( $parent_key );

            if ( substr( $key, -$length ) === $parent_key ) {
                $fields = $value;
            }
        }
    }
}

from mc-acf-flexible-template.

PseudoPsychosis avatar PseudoPsychosis commented on August 14, 2024

Adding the following code block after line 351 in mc-acf-flexible-template.php fixes the issue for flexible fields that are inside a clone field. It doesn't fix #8, but it could also be fixed easily in similar fashion.

if ( ! $fields && ! empty( $_POST['acf'] ) && is_array( $_POST['acf'] ) ) {
    foreach ( $_POST['acf'] as $field ) {
        if ( ! is_array( $field ) )
            continue;

        foreach ( $field as $key => $value ) {
            $length = strlen( $parent_key );

            if ( substr( $key, -$length ) === $parent_key ) {
                $fields = $value;
            }
        }
    }
}

You mention possibly being able to use this as a fix for #8, which has been something that I have been struggling with for some time. Can you create a PR to fix #8 too?

Thanks @julesrenaud!

from mc-acf-flexible-template.

PseudoPsychosis avatar PseudoPsychosis commented on August 14, 2024

@PseudoPsychosis I believe so. I think the solution I'm working on will fix both issues. I will post a PR soon.

You rock. Thank you!

from mc-acf-flexible-template.

sethwhitaker avatar sethwhitaker commented on August 14, 2024

Any update on a fix? desperately want to be able to use this plugin

from mc-acf-flexible-template.

CalebBarnes avatar CalebBarnes commented on August 14, 2024

It's been a few years but it seems that there was a PR for this that was never merged here #14

from mc-acf-flexible-template.

MarieComet avatar MarieComet commented on August 14, 2024

@CalebBarnes PR #14 is not related to this issue ("Make acf template tax optional") : 1d09c88

from mc-acf-flexible-template.

Related Issues (15)

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.