AnsPress_Common_Pages::base_page()
Description #
Layout of base page.
Source #
File: includes/common-pages.php
public static function base_page() { global $wp; $keywords = get_search_query(); $tax_relation = ! empty( $wp->query_vars['ap_tax_relation'] ) ? $wp->query_vars['ap_tax_relation'] : 'OR'; $args = array(); $args['tax_query'] = array( 'relation' => $tax_relation ); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query if ( false !== $keywords ) { $args['s'] = $keywords; } if ( is_front_page() ) { $args['paged'] = get_query_var( 'page' ); } // Set post parent. if ( get_query_var( 'post_parent', false ) ) { $args['post_parent'] = get_query_var( 'post_parent' ); } if ( ap_sanitize_unslash( 'unpublished', 'r' ) && is_user_logged_in() ) { $args['ap_show_unpublished'] = true; } /** * Filter main question list query arguments. * * @param array $args Wp_Query arguments. */ $args = apply_filters( 'ap_main_questions_args', $args ); anspress()->questions = new Question_Query( $args ); ap_get_template_part( 'archive' ); }
Expand full source code Collapse full source code View on GitHub: includes/common-pages.php:35
Add your comment