Make WordPress Core

Ticket #39120: 39120.term-query.patch

File 39120.term-query.patch, 1.1 KB (added by Offereins, 8 years ago)

Term Query methods

  • src/wp-includes/class-wp-term-query.php

    diff --git a/src/wp-includes/class-wp-term-query.php b/src/wp-includes/class-wp-term-query.php
    index 434d810..28d9cea 100644
    a b class WP_Term_Query { 
    965965
    966966                return $wpdb->prepare( '((t.name LIKE %s) OR (t.slug LIKE %s))', $like, $like );
    967967        }
     968
     969        /**
     970         * Retrieve query variable.
     971         *
     972         * @since 4.8.0
     973         *
     974         * @access public
     975         *
     976         * @param string $query_var Query variable key.
     977         * @param mixed  $default   Optional. Value to return if the query variable is not set. Default empty.
     978         * @return mixed Contents of the query variable.
     979         */
     980        public function get( $query_var, $default = '' ) {
     981                if ( isset( $this->query_vars[ $query_var ] ) ) {
     982                        return $this->query_vars[ $query_var ];
     983                }
     984
     985                return $default;
     986        }
     987
     988        /**
     989         * Set query variable.
     990         *
     991         * @since 4.8.0
     992         * @access public
     993         *
     994         * @param string $query_var Query variable key.
     995         * @param mixed  $value     Query variable value.
     996         */
     997        public function set($query_var, $value) {
     998                $this->query_vars[$query_var] = $value;
     999        }
    9681000}