Changeset 40340 for trunk/src/wp-includes/class-wp-site-query.php
- Timestamp:
- 03/27/2017 07:47:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-site-query.php
r38849 r40340 100 100 * 101 101 * @since 4.6.0 102 * @since 4.8.0 Introduced the 'lang_id', 'lang__in', and 'lang__not_in' parameters. 102 103 * @access public 103 104 * … … 139 140 * @type int $spam Limit results to spam sites. Accepts '1' or '0'. Default empty. 140 141 * @type int $deleted Limit results to deleted sites. Accepts '1' or '0'. Default empty. 142 * @type int $lang_id Limit results to a language ID. Default empty. 143 * @type array $lang__in Array of language IDs to include affiliated sites for. Default empty. 144 * @type array $lang__not_in Array of language IDs to exclude affiliated sites for. Default empty. 141 145 * @type string $search Search term(s) to retrieve matching sites for. Default empty. 142 146 * @type array $search_columns Array of column names to be searched. Accepts 'domain' and 'path'. … … 170 174 'spam' => null, 171 175 'deleted' => null, 176 'lang_id' => null, 177 'lang__in' => '', 178 'lang__not_in' => '', 172 179 'search' => '', 173 180 'search_columns' => array(), … … 470 477 $public = absint( $this->query_vars['public'] ); 471 478 $this->sql_clauses['where']['public'] = $wpdb->prepare( "public = %d ", $public ); 479 } 480 481 if ( is_numeric( $this->query_vars['lang_id'] ) ) { 482 $lang_id = absint( $this->query_vars['lang_id'] ); 483 $this->sql_clauses['where']['lang_id'] = $wpdb->prepare( "lang_id = %d ", $lang_id ); 484 } 485 486 // Parse site language IDs for an IN clause. 487 if ( ! empty( $this->query_vars['lang__in'] ) ) { 488 $this->sql_clauses['where']['lang__in'] = 'lang_id IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['lang__in'] ) ) . ' )'; 489 } 490 491 // Parse site language IDs for a NOT IN clause. 492 if ( ! empty( $this->query_vars['lang__not_in'] ) ) { 493 $this->sql_clauses['where']['lang__not_in'] = 'lang_id NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['lang__not_in'] ) ) . ' )'; 472 494 } 473 495
Note: See TracChangeset
for help on using the changeset viewer.