UrlToQueryItem.php
function resolve( $url = '', Array $query_string_vars = [ ] ) {
        if ( $this->done && empty( $this->error ) ) {
            return $this->query_vars;
        }
        $this->parseUrl( $url, $query_string_vars );
        $rewrite = (array) $this->resolver->getRewrite();
        if ( ! empty( $rewrite ) ) {
            list( $matches, $query ) = $this->parseRewriteRules( $rewrite );
            $this->setMatchedQuery( $matches, $query );
            $this->maybeAdmin();
        }
        return $this->resolveVars();
    }
function resolve( $url = '', Array $query_string_vars = [ ] ) {
        if ( $this->done && empty( $this->error ) ) {
            return $this->query_vars;
        }
        $this->parseUrl( $url, $query_string_vars );
        $rewrite = (array) $this->resolver->getRewrite();
        if ( ! empty( $rewrite ) ) {
            list( $matches, $query ) = $this->parseRewriteRules( $rewrite );
            $this->setMatchedQuery( $matches, $query );
            $this->maybeAdmin();
        }
        return $this->resolveVars();
    }
function resolve ( $ url = '' , Array $ query_string_vars = [ ] ) { if ( $ this -> done && empty ( $ this -> error ) ) { return $ this -> query_vars ; } $ this -> parseUrl ( $ url , $ query_string_vars ) ; $ rewrite = ( array ) $ this -> resolver -> getRewrite ( ) ; if ( ! empty ( $ rewrite ) ) { list ( $ matches , $ query ) = $ this -> parseRewriteRules ( $ rewrite ) ; $ this -> setMatchedQuery ( $ matches , $ query ) ; $ this -> maybeAdmin ( ) ; } return $ this -> resolveVars ( ) ; }
Resolve an url to an array of WP_Query arguments for main query.

@param string $url               Url to resolve
@param type $query_string_vars   Query variables to be added to the url
@return array|\WP_Error          Resolved query or WP_Error is something goes wrong
Resolve an url to an array of WP_Query arguments for main query .