Support

Account

Home Forums Feature Requests Flexible Content : Confirmation before deleting the layout

Solved

Flexible Content : Confirmation before deleting the layout

  • Hi everyone,

    When clicking on the “-” symbol the layout is deleted without confirmation.
    This is a bit dangerous for users who are not careful.

  • Hi @meneldil

    I’m afraid this is not possible. You need to modify the core files to do that. You can check how it works in “wp-content/plugins/advanced-custom-fields-pro/pro/assets/js/acf-pro-input.js”, but you need to apply the modification in “wp-content/plugins/advanced-custom-fields-pro/pro/assets/js/acf-pro-input.min.js”.

    Thanks 🙂

  • Hi @James,

    Thank you for your reply but why is this not possible?
    It is not possible to add a confirmation box ? 😮

  • Hi @meneldil

    It’s possible to add the confirmation box, but it won’t be working correctly. That’s because ACF won’t check if you click the “OK” or “Cancel” button so it will delete the layout no matter which one you click.

    You can check how it works in “wp-content/plugins/advanced-custom-fields-pro/pro/assets/js/acf-pro-input.js” on line 1086.

    If you want, you need to add the confirmation code in the core file (acf-pro-input.min.js).

    I hope this helps 🙂

  • Ok, thanks, but it’s not possible to do it for an upcoming update ? (nothing urgent)

  • Hi @meneldil

    If you want to submit a feature request, I suggest you open a new ticket instead. You can open a new ticket here: https://support.advancedcustomfields.com/new-ticket. That way, your request can be passed directly to the plugin author.

    Thanks 🙂

  • Hi @James,

    I don’t understand, this ticket is already in the category “Feature Requests”. 😮

  • Hi @meneldil

    Back then, the forum was used as a place to provide support to the users. But we have moved the support to a new environment. Thus the forum now is used as a place for the community instead. Even though the plugin author checks the forum too, but it’s not often.

    Now, the best way to get the plugin author’s attention is to submit a ticket through https://support.advancedcustomfields.com/new-ticket.

    I hope this makes sense 🙂

  • @meneldil

    I had the same request on a recent client site, and I’m enqueuing a script into the admin area to generate a confirmation message when trying to delete a layout.

    ;(function($) {
        acf.add_action('ready', function(){
            $('body').on('click', '.acf-flexible-content [data-event=remove-layout]', function( e ){
                return confirm("Delete row?");
            });
        });
    }(jQuery));
  • The functionality is native now.
    Thanks!

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Flexible Content : Confirmation before deleting the layout’ is closed to new replies.