Make WordPress Core


Ignore:
Timestamp:
01/11/2022 04:10:03 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Database: Add missing AS after INNER JOIN in some queries.

While AS is an optional keyword in SQL, it is commonly considered best practice to include it for better readability and compatibility. This also makes the queries more consistent with other queries using aliases in core.

Follow-up to [6359], [30238].

Props costdev, domainsupport.
Fixes #54769.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r52357 r52553  
    18381838    if ( $in_same_term || ! empty( $excluded_terms ) ) {
    18391839        if ( $in_same_term ) {
    1840             $join  .= " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";
     1840            $join  .= " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";
    18411841            $where .= $wpdb->prepare( 'AND tt.taxonomy = %s', $taxonomy );
    18421842
Note: See TracChangeset for help on using the changeset viewer.