/** * Fires during the WP parse_request hook to check to see if we're on a GlotPress page, if so * we can abort the main WP_Query logic as we won't need it in GlotPress. * a matching page. * * @since 1.0.0 */ function gp_parse_request() { if (is_glotpress()) { add_filter('posts_request', 'gp_abort_main_wp_query', 10, 2); } }
/** * Sets `WP_Query->is_home` to false during GlotPress requests. * * @since 1.0.0 * * @param WP_Query $query The WP_Query instance. */ function gp_set_is_home_false($query) { if (is_glotpress() && $query->is_home() && $query->is_main_query()) { $query->is_home = false; } }