Coding Standards: Wrap the `$this->request` property in `wp-includes/class-wp-*-query.php`.
This aims to improve readability by fitting the values on a single screen to avoid horizontal scrolling. See #54728. Built from https://develop.svn.wordpress.org/trunk@52973 git-svn-id: http://core.svn.wordpress.org/trunk@52562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
83c4cdf92b
commit
38dbd506e7
|
@ -960,7 +960,17 @@ class WP_Comment_Query {
|
|||
$this->sql_clauses['orderby'] = $orderby;
|
||||
$this->sql_clauses['limits'] = $limits;
|
||||
|
||||
$this->request = "{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}";
|
||||
$this->request = implode(
|
||||
' ',
|
||||
array(
|
||||
$this->sql_clauses['select'],
|
||||
$this->sql_clauses['from'],
|
||||
$where,
|
||||
$this->sql_clauses['groupby'],
|
||||
$this->sql_clauses['orderby'],
|
||||
$this->sql_clauses['limits'],
|
||||
)
|
||||
);
|
||||
|
||||
if ( $this->query_vars['count'] ) {
|
||||
return (int) $wpdb->get_var( $this->request );
|
||||
|
|
|
@ -480,7 +480,17 @@ class WP_Network_Query {
|
|||
$this->sql_clauses['orderby'] = $orderby;
|
||||
$this->sql_clauses['limits'] = $limits;
|
||||
|
||||
$this->request = "{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}";
|
||||
$this->request = implode(
|
||||
' ',
|
||||
array(
|
||||
$this->sql_clauses['select'],
|
||||
$this->sql_clauses['from'],
|
||||
$where,
|
||||
$this->sql_clauses['groupby'],
|
||||
$this->sql_clauses['orderby'],
|
||||
$this->sql_clauses['limits'],
|
||||
)
|
||||
);
|
||||
|
||||
if ( $this->query_vars['count'] ) {
|
||||
return (int) $wpdb->get_var( $this->request );
|
||||
|
|
|
@ -3000,7 +3000,18 @@ class WP_Query {
|
|||
$found_rows = 'SQL_CALC_FOUND_ROWS';
|
||||
}
|
||||
|
||||
$old_request = "SELECT $found_rows $distinct $fields FROM {$wpdb->posts} $join WHERE 1=1 $where $groupby $orderby $limits";
|
||||
$old_request = implode(
|
||||
' ',
|
||||
array(
|
||||
"SELECT $found_rows $distinct $fields",
|
||||
"FROM {$wpdb->posts} $join",
|
||||
"WHERE 1=1 $where",
|
||||
$groupby,
|
||||
$orderby,
|
||||
$limits,
|
||||
)
|
||||
);
|
||||
|
||||
$this->request = $old_request;
|
||||
|
||||
if ( ! $q['suppress_filters'] ) {
|
||||
|
@ -3086,7 +3097,17 @@ class WP_Query {
|
|||
if ( $split_the_query ) {
|
||||
// First get the IDs and then fill in the objects.
|
||||
|
||||
$this->request = "SELECT $found_rows $distinct {$wpdb->posts}.ID FROM {$wpdb->posts} $join WHERE 1=1 $where $groupby $orderby $limits";
|
||||
$this->request = implode(
|
||||
' ',
|
||||
array(
|
||||
"SELECT $found_rows $distinct {$wpdb->posts}.ID",
|
||||
"FROM {$wpdb->posts} $join",
|
||||
"WHERE 1=1 $where",
|
||||
$groupby,
|
||||
$orderby,
|
||||
$limits,
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Filters the Post IDs SQL request before sending.
|
||||
|
|
|
@ -683,7 +683,17 @@ class WP_Site_Query {
|
|||
$this->sql_clauses['orderby'] = $orderby;
|
||||
$this->sql_clauses['limits'] = $limits;
|
||||
|
||||
$this->request = "{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}";
|
||||
$this->request = implode(
|
||||
' ',
|
||||
array(
|
||||
$this->sql_clauses['select'],
|
||||
$this->sql_clauses['from'],
|
||||
$where,
|
||||
$this->sql_clauses['groupby'],
|
||||
$this->sql_clauses['orderby'],
|
||||
$this->sql_clauses['limits'],
|
||||
)
|
||||
);
|
||||
|
||||
if ( $this->query_vars['count'] ) {
|
||||
return (int) $wpdb->get_var( $this->request );
|
||||
|
|
|
@ -722,7 +722,16 @@ class WP_Term_Query {
|
|||
$this->sql_clauses['orderby'] = $orderby ? "$orderby $order" : '';
|
||||
$this->sql_clauses['limits'] = $limits;
|
||||
|
||||
$this->request = "{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}";
|
||||
$this->request = implode(
|
||||
' ',
|
||||
array(
|
||||
$this->sql_clauses['select'],
|
||||
$this->sql_clauses['from'],
|
||||
$where,
|
||||
$this->sql_clauses['orderby'],
|
||||
$this->sql_clauses['limits'],
|
||||
)
|
||||
);
|
||||
|
||||
$this->terms = null;
|
||||
|
||||
|
|
|
@ -770,7 +770,16 @@ class WP_User_Query {
|
|||
$this->results = apply_filters_ref_array( 'users_pre_query', array( null, &$this ) );
|
||||
|
||||
if ( null === $this->results ) {
|
||||
$this->request = "SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit";
|
||||
$this->request = implode(
|
||||
' ',
|
||||
array(
|
||||
"SELECT {$this->query_fields}",
|
||||
$this->query_from,
|
||||
$this->query_where,
|
||||
$this->query_orderby,
|
||||
$this->query_limit,
|
||||
)
|
||||
);
|
||||
|
||||
if ( is_array( $qv['fields'] ) || 'all' === $qv['fields'] ) {
|
||||
$this->results = $wpdb->get_results( $this->request );
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.0-alpha-52972';
|
||||
$wp_version = '6.0-alpha-52973';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue