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 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.