ap_get_questions( array $args = array() )

Description #

Get questions query.

Parameters #

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

Source #

File: includes/question-loop.php

	function ap_get_questions( $args = array() ) {
		if ( is_front_page() ) {
			$paged = (int) ap_sanitize_unslash( 'ap_paged', 'g', 1 );
		} else {
			$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
		}

		if ( ! isset( $args['post_parent'] ) ) {
			$args['post_parent'] = get_query_var( 'parent' ) ? get_query_var( 'parent' ) : false;
		}

		$args = wp_parse_args(
			$args,
			array(
				'showposts' => ap_opt( 'question_per_page' ),
				'paged'     => $paged,
				'ap_query'  => 'featured_post',
			)
		);

		return new Question_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