Last active
August 29, 2015 13:56
-
-
Save kachi/9043502 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
$c_message = '記事を公開します。宜しいでしょうか?'; | |
function confirm_publish(){ | |
// JavaScriptを管理画面フッターに挿入する | |
global $c_message; | |
echo '<script type="text/javascript"><!-- | |
var publish = document.getElementById("publish"); | |
if (publish !== null) publish.onclick = function(){ | |
return confirm("'.$c_message.'"); | |
}; | |
// --></script>'; | |
} | |
add_action('admin_footer', 'confirm_publish'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment