Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated to multiline strings with no spaces
  • Loading branch information
LukaszJaro committed Feb 26, 2024
commit 7a4658b8f123dc67d91f700c4f0703ecda7adf08
7 changes: 6 additions & 1 deletion src/wp-includes/class-wp-comment-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,12 @@ protected function get_comment_ids() {
$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 =
"{$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 );
Expand Down
7 changes: 6 additions & 1 deletion src/wp-includes/class-wp-network-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,12 @@ protected function get_network_ids() {
$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 =
"{$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 );
Expand Down
17 changes: 14 additions & 3 deletions src/wp-includes/class-wp-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3104,7 +3104,13 @@ public function get_posts() {
$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 =
"SELECT $found_rows $distinct $fields
FROM {$wpdb->posts} $join
WHERE 1=1 $where
$groupby
$orderby
$limits";

$this->request = $old_request;

Expand Down Expand Up @@ -3300,8 +3306,13 @@ public function get_posts() {
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 =
"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.
Expand Down
7 changes: 6 additions & 1 deletion src/wp-includes/class-wp-site-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,12 @@ protected function get_site_ids() {
$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 =
"{$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 );
Expand Down
7 changes: 6 additions & 1 deletion src/wp-includes/class-wp-term-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,12 @@ public function get_terms() {
$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 =
"{$this->sql_clauses['select']}
{$this->sql_clauses['from']}
{$where}
{$this->sql_clauses['orderby']}
{$this->sql_clauses['limits']}";

$this->terms = null;

Expand Down
7 changes: 6 additions & 1 deletion src/wp-includes/class-wp-user-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,12 @@ public function 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 =
"SELECT {$this->query_fields}
{$this->query_from}
{$this->query_where}
{$this->query_orderby}
{$this->query_limit}";
$cache_value = false;
$cache_key = $this->generate_cache_key( $qv, $this->request );
$cache_group = 'user-queries';
Expand Down