Make WordPress Core

Ticket #58372: wp_prepare_code_format.diff

File wp_prepare_code_format.diff, 3.0 KB (added by umeshmcakadi, 16 months ago)
  • src/wp-admin/export.php

     src/wp-admin/export.php        | 10 ++++------
     src/wp-includes/deprecated.php | 12 ++++--------
     src/wp-includes/media.php      | 10 ++++------
     src/wp-includes/user.php       | 10 ++++------
     4 files changed, 16 insertions(+), 26 deletions(-)
    
    diff --git a/src/wp-admin/export.php b/src/wp-admin/export.php
    index 6e4c335190..7c59c9e6c0 100644
    a b function export_date_options( $post_type = 'post' ) { 
    141141
    142142        $months = $wpdb->get_results(
    143143                $wpdb->prepare(
    144                         "
    145                 SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
    146                 FROM $wpdb->posts
    147                 WHERE post_type = %s AND post_status != 'auto-draft'
    148                 ORDER BY post_date DESC
    149                         ",
     144                        "SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
     145                        FROM $wpdb->posts
     146                        WHERE post_type = %s AND post_status != 'auto-draft'
     147                        ORDER BY post_date DESC",
    150148                        $post_type
    151149                )
    152150        );
  • src/wp-includes/deprecated.php

    diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php
    index d2885ef497..f72cf4a4c0 100644
    a b function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' ) 
    45624562                $post_type           = esc_sql( $post_type );
    45634563                $post_type_in_string = "'" . implode( "','", $post_type ) . "'";
    45644564                $sql                 = $wpdb->prepare(
    4565                         "
    4566                         SELECT ID
     4565                        "SELECT ID
    45674566                        FROM $wpdb->posts
    45684567                        WHERE post_title = %s
    4569                         AND post_type IN ($post_type_in_string)
    4570                 ",
     4568                        AND post_type IN ($post_type_in_string)",
    45714569                        $page_title
    45724570                );
    45734571        } else {
    4574                 $sql = $wpdb->prepare(
    4575                         "
     4572                $sql = $wpdb->prepare("
    45764573                        SELECT ID
    45774574                        FROM $wpdb->posts
    45784575                        WHERE post_title = %s
    4579                         AND post_type = %s
    4580                 ",
     4576                        AND post_type = %s",
    45814577                        $page_title,
    45824578                        $post_type
    45834579                );
  • src/wp-includes/media.php

    diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
    index 27dd4dfb3a..ccc7ac1aa5 100644
    a b function wp_enqueue_media( $args = array() ) { 
    45434543        if ( ! is_array( $months ) ) {
    45444544                $months = $wpdb->get_results(
    45454545                        $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                 ",
     4546                                "SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
     4547                                FROM $wpdb->posts
     4548                                WHERE post_type = %s
     4549                                ORDER BY post_date DESC",
    45524550                                'attachment'
    45534551                        )
    45544552                );
  • src/wp-includes/user.php

    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index 0669a052d0..8453c22a80 100644
    a b function wp_get_users_with_no_role( $site_id = null ) { 
    35453545        $regex = preg_replace( '/[^a-zA-Z_\|-]/', '', $regex );
    35463546        $users = $wpdb->get_col(
    35473547                $wpdb->prepare(
    3548                         "
    3549                 SELECT user_id
    3550                 FROM $wpdb->usermeta
    3551                 WHERE meta_key = '{$prefix}capabilities'
    3552                 AND meta_value NOT REGEXP %s
    3553         ",
     3548                        "SELECT user_id
     3549                        FROM $wpdb->usermeta
     3550                        WHERE meta_key = '{$prefix}capabilities'
     3551                        AND meta_value NOT REGEXP %s",
    35543552                        $regex
    35553553                )
    35563554        );