Created
May 30, 2017 14:11
-
-
Save darinronne/a678d3c0aa2dac2421e465ac0f1abd24 to your computer and use it in GitHub Desktop.
ACF Confirm Row Deletion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Confirm Deletion of an ACF Row | |
add_action('acf/input/admin_head', 'my_acf_confirm_row_deletion'); | |
function my_acf_confirm_row_deletion() { | |
?> | |
<script type="text/javascript"> | |
(function($) { | |
acf.add_action('ready', function(){ | |
$('body').on('click', '[data-event="remove-row"]', function( e ){ | |
return confirm("Delete row?"); | |
}); | |
}); | |
})(jQuery); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment