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

git-svn-id: https://develop.svn.wordpress.org/trunk@16018 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu
2010-10-27 18:16:52 +00:00
parent 9cc035e926
commit 174c0acfb4
4 changed files with 68 additions and 49 deletions

View File

@@ -534,6 +534,44 @@ class WP {
*/
class WP_Object_Query {
/**
* Query vars, after parsing
*
* @since 3.1.0
* @access public
* @var array
*/
var $query_vars;
/**
* Retrieve query variable.
*
* @since 3.1.0
* @access public
*
* @param string $query_var Query variable key.
* @return mixed
*/
function get( $query_var ) {
if ( isset( $this->query_vars[$query_var] ) )
return $this->query_vars[$query_var];
return '';
}
/**
* Set query variable.
*
* @since 3.1.0
* @access public
*
* @param string $query_var Query variable key.
* @param mixed $value Query variable value.
*/
function set( $query_var, $value ) {
$this->query_vars[ $query_var ] = $value;
}
/*
* Populates the $meta_query property
*