fill_query_vars example


    public function parse_query( $query = '' ) {
        if ( ! empty( $query ) ) {
            $this->init();
            $this->query      = wp_parse_args( $query );
            $this->query_vars = $this->query;
        } elseif ( ! isset( $this->query ) ) {
            $this->query = $this->query_vars;
        }

        $this->query_vars         = $this->fill_query_vars( $this->query_vars );
        $qv                       = &$this->query_vars;
        $this->query_vars_changed = true;

        if ( ! empty( $qv['robots'] ) ) {
            $this->is_robots = true;
        } elseif ( ! empty( $qv['favicon'] ) ) {
            $this->is_favicon = true;
        }

        if ( ! is_scalar( $qv['p'] ) || (int) $qv['p'] < 0 ) {
            $qv['p']     = 0;
            

    public function prepare_query( $query = array() ) {
        global $wpdb$wp_roles;

        if ( empty( $this->query_vars ) || ! empty( $query ) ) {
            $this->query_limit = null;
            $this->query_vars  = $this->fill_query_vars( $query );
        }

        /** * Fires before the WP_User_Query has been parsed. * * The passed WP_User_Query object contains the query variables, * not yet passed into SQL. * * @since 4.0.0 * * @param WP_User_Query $query Current instance of WP_User_Query (passed by reference). */
Home | Imprint | This part of the site doesn't use cookies.