Ticket #37937: v2.diff
File v2.diff, 3.8 KB (added by , 8 years ago) |
---|
-
src/wp-includes/class-wp-site-query.php
134 134 * @type string $path Limit results to those affiliated with a given path. Default empty. 135 135 * @type array $path__in Array of paths to include affiliated sites for. Default empty. 136 136 * @type array $path__not_in Array of paths to exclude affiliated sites for. Default empty. 137 * @type int $public Limit results to public sites. Accepts '1' or '0'. Default empty.138 * @type int $archived Limit results to archived sites. Accepts '1' or '0'. Default empty.139 * @type int $mature Limit results to mature sites. Accepts '1' or '0'. Default empty.140 * @type int $spam Limit results to spam sites. Accepts '1' or '0'. Default empty.141 * @type int $deleted Limit results to deleted sites. Accepts '1' or '0'. Default empty.137 * @type mixed $public Limit results to public sites. Accepts boolean values. Default null. 138 * @type mixed $archived Limit results to archived sites. Accepts boolean values. Default null. 139 * @type mixed $mature Limit results to mature sites. Accepts boolean values. Default null. 140 * @type mixed $spam Limit results to spam sites. Accepts boolean values. Default null. 141 * @type mixed $deleted Limit results to deleted sites. Accepts boolean values. Default null. 142 142 * @type int $lang_id Limit results to a language ID. Default empty. 143 143 * @type array $lang__in Array of language IDs to include affiliated sites for. Default empty. 144 144 * @type array $lang__not_in Array of language IDs to exclude affiliated sites for. Default empty. … … 453 453 $this->sql_clauses['where']['path__not_in'] = "path NOT IN ( '" . implode( "', '", $wpdb->_escape( $this->query_vars['path__not_in'] ) ) . "' )"; 454 454 } 455 455 456 if ( is_numeric( $this->query_vars['archived'] ) ) {457 $archived = absint( $this->query_vars['archived'] );456 if ( ! is_null( $this->query_vars['archived'] ) ) { 457 $archived = wp_validate_boolean( $this->query_vars['archived'] ) ? 1 : 0; 458 458 $this->sql_clauses['where']['archived'] = $wpdb->prepare( "archived = %d ", $archived ); 459 459 } 460 460 461 if ( is_numeric( $this->query_vars['mature'] ) ) {462 $mature = absint( $this->query_vars['mature'] );461 if ( ! is_null( $this->query_vars['mature'] ) ) { 462 $mature = wp_validate_boolean( $this->query_vars['mature'] ) ? 1 : 0; 463 463 $this->sql_clauses['where']['mature'] = $wpdb->prepare( "mature = %d ", $mature ); 464 464 } 465 465 466 if ( is_numeric( $this->query_vars['spam'] ) ) {467 $spam = absint( $this->query_vars['spam'] );466 if ( ! is_null( $this->query_vars['spam'] ) ) { 467 $spam = wp_validate_boolean( $this->query_vars['spam'] ) ? 1 : 0; 468 468 $this->sql_clauses['where']['spam'] = $wpdb->prepare( "spam = %d ", $spam ); 469 469 } 470 470 471 if ( is_numeric( $this->query_vars['deleted'] ) ) {472 $deleted = absint( $this->query_vars['deleted'] );471 if ( ! is_null( $this->query_vars['deleted'] ) ) { 472 $deleted = wp_validate_boolean( $this->query_vars['deleted'] ) ? 1 : 0; 473 473 $this->sql_clauses['where']['deleted'] = $wpdb->prepare( "deleted = %d ", $deleted ); 474 474 } 475 475 476 if ( is_numeric( $this->query_vars['public'] ) ) {477 $public = absint( $this->query_vars['public'] );476 if ( ! is_null( $this->query_vars['public'] ) ) { 477 $public = wp_validate_boolean( $this->query_vars['public'] ) ? 1 : 0; 478 478 $this->sql_clauses['where']['public'] = $wpdb->prepare( "public = %d ", $public ); 479 479 } 480 480