]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-tax-query.php
WordPress 4.6.3-scripts
[autoinstalls/wordpress.git] / wp-includes / class-wp-tax-query.php
index 356b69292c701f809f3b46931d4769a34972fabf..9bff196f28e115c3c09c4f4ac4693284e3b738f2 100644 (file)
@@ -24,7 +24,7 @@ class WP_Tax_Query {
        /**
         * Array of taxonomy queries.
         *
        /**
         * Array of taxonomy queries.
         *
-        * See {@see WP_Tax_Query::__construct()} for information on tax query arguments.
+        * See WP_Tax_Query::__construct() for information on tax query arguments.
         *
         * @since 3.1.0
         * @access public
         *
         * @since 3.1.0
         * @access public
@@ -440,7 +440,7 @@ class WP_Tax_Query {
                                // Store the alias with this clause, so later siblings can use it.
                                $clause['alias'] = $alias;
 
                                // Store the alias with this clause, so later siblings can use it.
                                $clause['alias'] = $alias;
 
-                               $join .= " INNER JOIN $wpdb->term_relationships";
+                               $join .= " LEFT JOIN $wpdb->term_relationships";
                                $join .= $i ? " AS $alias" : '';
                                $join .= " ON ($this->primary_table.$this->primary_id_column = $alias.object_id)";
                        }
                                $join .= $i ? " AS $alias" : '';
                                $join .= " ON ($this->primary_table.$this->primary_id_column = $alias.object_id)";
                        }
@@ -557,19 +557,19 @@ class WP_Tax_Query {
         * @since 3.2.0
         * @access private
         *
         * @since 3.2.0
         * @access private
         *
-        * @param array &$query The single query.
+        * @param array $query The single query. Passed by reference.
         */
        private function clean_query( &$query ) {
                if ( empty( $query['taxonomy'] ) ) {
                        if ( 'term_taxonomy_id' !== $query['field'] ) {
         */
        private function clean_query( &$query ) {
                if ( empty( $query['taxonomy'] ) ) {
                        if ( 'term_taxonomy_id' !== $query['field'] ) {
-                               $query = new WP_Error( 'Invalid taxonomy' );
+                               $query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
                                return;
                        }
 
                        // so long as there are shared terms, include_children requires that a taxonomy is set
                        $query['include_children'] = false;
                } elseif ( ! taxonomy_exists( $query['taxonomy'] ) ) {
                                return;
                        }
 
                        // so long as there are shared terms, include_children requires that a taxonomy is set
                        $query['include_children'] = false;
                } elseif ( ! taxonomy_exists( $query['taxonomy'] ) ) {
-                       $query = new WP_Error( 'Invalid taxonomy' );
+                       $query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
                        return;
                }
 
                        return;
                }
 
@@ -599,7 +599,7 @@ class WP_Tax_Query {
         *
         * @global wpdb $wpdb The WordPress database abstraction object.
         *
         *
         * @global wpdb $wpdb The WordPress database abstraction object.
         *
-        * @param array  &$query          The single query.
+        * @param array  $query           The single query. Passed by reference.
         * @param string $resulting_field The resulting field. Accepts 'slug', 'name', 'term_taxonomy_id',
         *                                or 'term_id'. Default 'term_id'.
         */
         * @param string $resulting_field The resulting field. Accepts 'slug', 'name', 'term_taxonomy_id',
         *                                or 'term_id'. Default 'term_id'.
         */
@@ -655,7 +655,7 @@ class WP_Tax_Query {
                }
 
                if ( 'AND' == $query['operator'] && count( $terms ) < count( $query['terms'] ) ) {
                }
 
                if ( 'AND' == $query['operator'] && count( $terms ) < count( $query['terms'] ) ) {
-                       $query = new WP_Error( 'Inexistent terms' );
+                       $query = new WP_Error( 'inexistent_terms', __( 'Inexistent terms.' ) );
                        return;
                }
 
                        return;
                }