Problem with wordpress has_action() function

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 hook does not exist then the code does not show any alert message.

<script type=”text/javascript”>
var flag=<?php echo has_action(‘shutdown’);?>;

if (typeof flag !== ‘undefined’) {
alert(‘shutdown hook exists’);
}
else {
alert(‘no shutdown hooks’);
}
</script>

Read more here:: Problem with wordpress has_action() function

Leave a Reply

Your email address will not be published. Required fields are marked *