-
-
Save HamGuy/4c97cf9ba98c0d8726d8 to your computer and use it in GitHub Desktop.
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
/* = Add a "molly guard" to the publish button */ | |
add_action( 'admin_print_footer_scripts', 'sr_publish_molly_guard' ); | |
function sr_publish_molly_guard() { | |
echo <<<EOT | |
<script> | |
jQuery(document).ready(function($){ | |
$('#publishing-action input[name="publish"]').click(function() { | |
if(confirm('Are you sure you want to publish this?')) { | |
return true; | |
} else { | |
$('#publishing-action .spinner').hide(); | |
$('#publishing-action img').hide(); | |
$(this).removeClass('button-primary-disabled'); | |
return false; | |
} | |
}); | |
}); | |
</script> | |
EOT; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment