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.