AP_QA_Query_Hooks::modify_query( array $posts, object $query )
Description #
Modify main query.
Parameters #
- $postsarray (Required) Array of post object.
- $queryobject (Required) Wp_Query object.
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' ) ) ]; } }
Expand full source code Collapse full source code View on GitHub: includes/qaquery-hooks.php:171
Add your comment