Created
January 11, 2018 21:38
-
-
Save elvismdev/c801f0cf15d237dafd159c7f27769422 to your computer and use it in GitHub Desktop.
JS alert/confirmation pop-up before permanently erase all content items in the WordPress trash.
This file contains 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
<?php | |
function trash_empty_confirmation() { ?> | |
<script type="text/javascript"> | |
(function($) { | |
$('[id=delete_all]').click(function(e){ | |
return confirm( "Are you sure you want to permanently erase all content items in the Trash ?" ); | |
}); | |
})( jQuery ); | |
</script> | |
<?php } | |
add_action( 'admin_footer-edit.php', 'trash_empty_confirmation' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment