Changeset 41760 for trunk/src/wp-includes/class-wp-term-query.php
- Timestamp:
- 10/05/2017 12:36:43 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-term-query.php
r41377 r41760 88 88 * @since 4.6.0 Introduced 'term_taxonomy_id' parameter. 89 89 * @since 4.7.0 Introduced 'object_ids' parameter. 90 * @since 4.9.0 Added 'slug__in' support for 'orderby'. 90 91 * 91 92 * @param string|array $query { … … 99 100 * 'slug', 'term_group', 'term_id', 'id', 'description', 'parent'), 100 101 * 'count' for term taxonomy count, 'include' to match the 101 * 'order' of the $include param, 'meta_value', 'meta_value_num', 102 * 'order' of the $include param, 'slug__in' to match the 103 * 'order' of the $slug param, 'meta_value', 'meta_value_num', 102 104 * the value of `$meta_key`, the array keys of `$meta_query`, or 103 105 * 'none' to omit the ORDER BY clause. Defaults to 'name'. … … 842 844 $include = implode( ',', wp_parse_id_list( $this->query_vars['include'] ) ); 843 845 $orderby = "FIELD( t.term_id, $include )"; 846 } elseif ( 'slug__in' == $_orderby && ! empty( $this->query_vars['slug'] ) && is_array( $this->query_vars['slug'] ) ) { 847 $slugs = implode( "', '", array_map( 'sanitize_title_for_query', $this->query_vars['slug__in'] ) ); 848 $orderby = "FIELD( t.slug, '" . $slugs . "')"; 844 849 } elseif ( 'none' == $_orderby ) { 845 850 $orderby = '';
Note: See TracChangeset
for help on using the changeset viewer.