最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Problem with wordpress has_action() function

programmeradmin0浏览0评论

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>
发布评论

评论列表(0)

  1. 暂无评论