ap_get_answers( array $args = array() )

Description #

Display answers of a question

Parameters #

  • $args
    array (Optional) Answers query arguments. Default value: array()

Changelog #

VersionDescription
2.0Introduced.

Source #

File: includes/answer-loop.php

function ap_get_answers( $args = array() ) {
	if ( empty( $args['question_id'] ) ) {
		$args['question_id'] = get_question_id();
	}

	if ( ! isset( $args['ap_order_by'] ) ) {
		$order_by = ap_sanitize_unslash( 'order_by', 'g' );

		$args['ap_order_by'] = ! empty( $order_by ) ? $order_by : ap_opt( 'answers_sort' );
	}

	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