AP_QA_Query_Hooks::modify_query( array $posts, object $query )

Description #

Modify main query.

Parameters #

  • $posts
    array (Required) Array of post object.
  • $query
    object (Required) Wp_Query object.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: includes/qaquery-hooks.php

	public static function modify_query( $posts, $query ) {
		if ( $query->is_main_query() && $query->is_search() && 'question' === get_query_var( 'post_type' ) ) {
			return [ get_post( ap_opt( 'base_page' ) ) ];
		}
	}

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