AnsPress_Hooks::get_comments_number( integer $count, integer $post_id )
Description #
Include anspress comments count.
This fixes no comments visible while using DIVI.
Parameters #
- $countinteger (Required) Comments count
- $post_idinteger (Required) Post ID.
Source #
File: includes/hooks.php
public static function get_comments_number( $count, $post_id ) {
global $post_type;
if ( $post_type == 'question' || ( defined( 'DOING_AJAX' ) && true === DOING_AJAX && 'ap_form_comment' === ap_isset_post_value( 'action' ) ) ) {
$get_comments = get_comments( array(
'post_id' => $post_id,
'status' => 'approve'
) );
$types = separate_comments( $get_comments );
if( ! empty( $types['anspress'] ) ) {
$count = count( $types['anspress'] );
}
}
return $count;
}
Expand full source code Collapse full source code View on GitHub: includes/hooks.php:1070
Add your comment