Make WordPress Core


Ignore:
Timestamp:
07/02/2019 11:41:16 PM (5 years ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.

See #47632.

File:
1 edited

Legend:

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

    r45580 r45590  
    10811081
    10821082        // If on an author archive, use the author's display name.
    1083     } elseif ( is_author() && $author = get_queried_object() ) {
     1083    } elseif ( is_author() && get_queried_object() ) {
     1084        $author         = get_queried_object();
    10841085        $title['title'] = $author->display_name;
    10851086
     
    18751876
    18761877    if ( 'monthly' == $r['type'] ) {
    1877         $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit";
    1878         $key   = md5( $query );
    1879         $key   = "wp_get_archives:$key:$last_changed";
    1880         if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
     1878        $query   = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit";
     1879        $key     = md5( $query );
     1880        $key     = "wp_get_archives:$key:$last_changed";
     1881        $results = wp_cache_get( $key, 'posts' );
     1882        if ( ! $results ) {
    18811883            $results = $wpdb->get_results( $query );
    18821884            wp_cache_set( $key, $results, 'posts' );
     
    18991901        }
    19001902    } elseif ( 'yearly' == $r['type'] ) {
    1901         $query = "SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order $limit";
    1902         $key   = md5( $query );
    1903         $key   = "wp_get_archives:$key:$last_changed";
    1904         if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
     1903        $query   = "SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order $limit";
     1904        $key     = md5( $query );
     1905        $key     = "wp_get_archives:$key:$last_changed";
     1906        $results = wp_cache_get( $key, 'posts' );
     1907        if ( ! $results ) {
    19051908            $results = $wpdb->get_results( $query );
    19061909            wp_cache_set( $key, $results, 'posts' );
     
    19221925        }
    19231926    } elseif ( 'daily' == $r['type'] ) {
    1924         $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit";
    1925         $key   = md5( $query );
    1926         $key   = "wp_get_archives:$key:$last_changed";
    1927         if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
     1927        $query   = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit";
     1928        $key     = md5( $query );
     1929        $key     = "wp_get_archives:$key:$last_changed";
     1930        $results = wp_cache_get( $key, 'posts' );
     1931        if ( ! $results ) {
    19281932            $results = $wpdb->get_results( $query );
    19291933            wp_cache_set( $key, $results, 'posts' );
     
    19461950        }
    19471951    } elseif ( 'weekly' == $r['type'] ) {
    1948         $week  = _wp_mysql_week( '`post_date`' );
    1949         $query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` $order $limit";
    1950         $key   = md5( $query );
    1951         $key   = "wp_get_archives:$key:$last_changed";
    1952         if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
     1952        $week    = _wp_mysql_week( '`post_date`' );
     1953        $query   = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` $order $limit";
     1954        $key     = md5( $query );
     1955        $key     = "wp_get_archives:$key:$last_changed";
     1956        $results = wp_cache_get( $key, 'posts' );
     1957        if ( ! $results ) {
    19531958            $results = $wpdb->get_results( $query );
    19541959            wp_cache_set( $key, $results, 'posts' );
     
    19881993        $key     = md5( $query );
    19891994        $key     = "wp_get_archives:$key:$last_changed";
    1990         if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
     1995        $results = wp_cache_get( $key, 'posts' );
     1996        if ( ! $results ) {
    19911997            $results = $wpdb->get_results( $query );
    19921998            wp_cache_set( $key, $results, 'posts' );
     
    38313837    }
    38323838
    3833     if ( $lang = get_bloginfo( 'language' ) ) {
     3839    $lang = get_bloginfo( 'language' );
     3840    if ( $lang ) {
    38343841        if ( get_option( 'html_type' ) == 'text/html' || $doctype == 'html' ) {
    38353842            $attributes[] = 'lang="' . esc_attr( $lang ) . '"';
Note: See TracChangeset for help on using the changeset viewer.