Make WordPress Core


Ignore:
Timestamp:
05/25/2023 12:53:24 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Improve formatting of some SQL queries for better readability.

This corrects the placement of double quotes around the query and makes sure the alignment is consistent.

Props umeshmcakadi, mukesh27, krupalpanchal, dhrumilk, SergeyBiryukov.
Fixes #58372.

File:
1 edited

Legend:

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

    r55847 r55857  
    44854485    if ( null === $show_audio_playlist ) {
    44864486        $show_audio_playlist = $wpdb->get_var(
    4487             "
    4488             SELECT ID
     4487            "SELECT ID
    44894488            FROM $wpdb->posts
    44904489            WHERE post_type = 'attachment'
    44914490            AND post_mime_type LIKE 'audio%'
    4492             LIMIT 1
    4493         "
     4491            LIMIT 1"
    44944492        );
    44954493    }
     
    45154513    if ( null === $show_video_playlist ) {
    45164514        $show_video_playlist = $wpdb->get_var(
    4517             "
    4518             SELECT ID
     4515            "SELECT ID
    45194516            FROM $wpdb->posts
    45204517            WHERE post_type = 'attachment'
    45214518            AND post_mime_type LIKE 'video%'
    4522             LIMIT 1
    4523         "
     4519            LIMIT 1"
    45244520        );
    45254521    }
     
    45444540        $months = $wpdb->get_results(
    45454541            $wpdb->prepare(
    4546                 "
    4547             SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
    4548             FROM $wpdb->posts
    4549             WHERE post_type = %s
    4550             ORDER BY post_date DESC
    4551         ",
     4542                "SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
     4543                FROM $wpdb->posts
     4544                WHERE post_type = %s
     4545                ORDER BY post_date DESC",
    45524546                'attachment'
    45534547            )
Note: See TracChangeset for help on using the changeset viewer.