lib/QueryIterator.php
public static function handle_maybe_custom_posts_page( $query ) {
		if ( $custom_posts_page = get_option('page_for_posts') ) {
			if ( isset($query->query['p']) && $query->query['p'] == $custom_posts_page ) {
				return new \WP_Query(array('post_type' => 'post'));
			}
		}
		return $query;
	}
public static function handle_maybe_custom_posts_page( $query ) {
		if ( $custom_posts_page = get_option('page_for_posts') ) {
			if ( isset($query->query['p']) && $query->query['p'] == $custom_posts_page ) {
				return new \WP_Query(array('post_type' => 'post'));
			}
		}
		return $query;
	}
public static function handle_maybe_custom_posts_page ( $ query ) { if ( $ custom_posts_page = get_option ( 'page_for_posts' ) ) { if ( isset ( $ query -> query [ 'p' ] ) && $ query -> query [ 'p' ] == $ custom_posts_page ) { return new \ WP_Query ( array ( 'post_type' => 'post' ) ) ; } } return $ query ; }
this will test for whether a custom page to display posts is active, and if so, set the query to the default
@param  WP_Query $query the original query recived from WordPress
@return WP_Query
this will test for whether a custom page to display posts is active and if so set the query to the default