Support

Account

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

  • 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 🙂