ap_get_best_answer( integer $question_id = false )

Description #

Get selected answer object

Parameters #

  • $question_id
    integer (Optional) Question ID. Default value: false

Changelog #

VersionDescription
2.0Introduced.

Source #

File: includes/answer-loop.php

function ap_get_best_answer( $question_id = false ) {
	if ( false === $question_id ) {
		$question_id = get_question_id();
	}

	$args = array(
		'only_best_answer' => true,
		'question_id'      => $question_id,
	);
	return new Answers_Query( $args );
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment