ap_count_published_answers( integer $question_id )
Description #
Return numbers of published answers.
Parameters #
- $question_idinteger (Required) Question ID.
Source #
File: includes/answer-loop.php
function ap_count_published_answers( $question_id ) { global $wpdb; $query = $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts where post_parent = %d AND post_status = %s AND post_type = %s", $question_id, 'publish', 'answer' ); $count = $wpdb->get_var( $query ); // phpcs:ignore WordPress.DB return $count; }
Expand full source code Collapse full source code View on GitHub: includes/answer-loop.php:377
Add your comment