AP_QA_Query_Hooks::pre_get_posts( WP_Query $query )

Description #

Include all post status in single question so that we can show custom messages.

Parameters #

  • $query
    WP_Query (Required) Query loop.

Changelog #

VersionDescription
4.1.5Include future questions as well.
4.1.4Introduced.

Source #

File: includes/qaquery-hooks.php

	public static function pre_get_posts( $query ) {
		if ( $query->is_single() && $query->is_main_query() && 'question' === get_query_var( 'post_type' ) ) {
			$query->set( 'post_status', array( 'publish', 'trash', 'moderate', 'private_post', 'future', 'ap_spam' ) );
		}
	}

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