admin管理员组文章数量:1394162
I use last version of Wordpress and the plugin : Awesome Support.
In the code, I have this filter :
if ( apply_filters('wpas_show_reply_form_front_end',true, $post ) ) {
?>
<h3><?php _e( 'Write a reply', 'awesome-support' ); ?></h3>
<?php
wpas_get_reply_form();
} ?>
And I want to condition this filter, so in my theme functions.php
, I use this :
// The filter callback function for answering a ticket
function wpas_show_reply_form_front_end_callback( $arg1, $ticket ) {
// .... my logic to get total replies
if ($total_replies >= 2) {
// user can't answer more
echo 'Cannot answer !';
__return_false();
}
__return_true();
}
add_filter( 'wpas_show_reply_form_front_end', 'wpas_show_reply_form_front_end_callback', 40, 3 );
The fact is I can see my echo 'Cannot answer !';
but the filter returns true
all the time. Do I miss anything ? I want to condition my filter according to my logic.
本文标签: filtersaddfilter doesn39t return false
版权声明:本文标题:filters - add_filter doesn't return false? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744703974a2620727.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论