Support

Account

Home Forums Backend Issues (wp-admin) No navigation warning after deleting fields?

Helping

No navigation warning after deleting fields?

  • Hi,

    Why is there no navigation warning after deleting a field?

    I get a warning when I ADD a field and trying to navigate from the field group, but not after deleting one or multiple fields.

    ACF Version 5.3.10

  • Hi @niclasu

    You can fix it by using this code in your functions.php file:

    function my_acf_field_group_admin_head() {
        
        ?>
        <script type="text/javascript">
        (function($){
       
            acf.add_action('remove', function( $el ){
        
                window.onbeforeunload = function() {
                    return true;
                }
    
            });
            
            
    
        })(jQuery);
        </script>
        <?php
        
    }
    
    add_action('acf/field_group/admin_head', 'my_acf_field_group_admin_head');

    I hope this helps 🙂

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

You must be logged in to reply to this topic.