admin管理员组

文章数量:1404340

Inside a WordPress plugin i am trying to check whether shutdown hook exists or not using has_action() function.I am trying to alert a message based on the checking.The problem is when the has_action() function is not executed due to cache then the code does not show any alert message.

<script type="text/javascript">
var flag=<?php echo has_action('shutdown');?>; 

if (typeof flag !== 'undefined' || flag !== false || flag === 1) {
 alert('shutdown hook exists');
}
else {
alert('no shutdown hooks');
}
</script>

本文标签: pluginsProblem with wordpress hasaction() function