Make WordPress Core


Ignore:
Timestamp:
10/27/2010 06:16:52 PM (16 years ago)
Author:
scribu
Message:

Move get() and set() methods from WP_Query to WP_Object_Query. See #15032

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r16003 r16018  
    535535class WP_Object_Query {
    536536
     537        /**
     538         * Query vars, after parsing
     539         *
     540         * @since 3.1.0
     541         * @access public
     542         * @var array
     543         */
     544        var $query_vars;
     545
     546        /**
     547         * Retrieve query variable.
     548         *
     549         * @since 3.1.0
     550         * @access public
     551         *
     552         * @param string $query_var Query variable key.
     553         * @return mixed
     554         */
     555        function get( $query_var ) {
     556                if ( isset( $this->query_vars[$query_var] ) )
     557                        return $this->query_vars[$query_var];
     558
     559                return '';
     560        }
     561
     562        /**
     563         * Set query variable.
     564         *
     565         * @since 3.1.0
     566         * @access public
     567         *
     568         * @param string $query_var Query variable key.
     569         * @param mixed $value Query variable value.
     570         */
     571        function set( $query_var, $value ) {
     572                $this->query_vars[ $query_var ] = $value;
     573        }
     574
    537575        /*
    538576         * Populates the $meta_query property
Note: See TracChangeset for help on using the changeset viewer.