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/bookmark.php

    r44546 r45590  
    3535        if ( isset( $GLOBALS['link'] ) && ( $GLOBALS['link']->link_id == $bookmark ) ) {
    3636            $_bookmark = & $GLOBALS['link'];
    37         } elseif ( ! $_bookmark = wp_cache_get( $bookmark, 'bookmark' ) ) {
    38             $_bookmark = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark ) );
    39             if ( $_bookmark ) {
    40                 $_bookmark->link_category = array_unique( wp_get_object_terms( $_bookmark->link_id, 'link_category', array( 'fields' => 'ids' ) ) );
    41                 wp_cache_add( $_bookmark->link_id, $_bookmark, 'bookmark' );
     37        } else {
     38            $_bookmark = wp_cache_get( $bookmark, 'bookmark' );
     39            if ( ! $_bookmark ) {
     40                $_bookmark = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark ) );
     41                if ( $_bookmark ) {
     42                    $_bookmark->link_category = array_unique( wp_get_object_terms( $_bookmark->link_id, 'link_category', array( 'fields' => 'ids' ) ) );
     43                    wp_cache_add( $_bookmark->link_id, $_bookmark, 'bookmark' );
     44                }
    4245            }
    4346        }
     
    140143
    141144    $key   = md5( serialize( $r ) );
    142     $cache = false;
    143     if ( 'rand' !== $r['orderby'] && $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
     145    $cache = wp_cache_get( 'get_bookmarks', 'bookmark' );
     146    if ( 'rand' !== $r['orderby'] && $cache ) {
    144147        if ( is_array( $cache ) && isset( $cache[ $key ] ) ) {
    145148            $bookmarks = $cache[ $key ];
     
    205208
    206209    if ( ! empty( $r['category_name'] ) ) {
    207         if ( $r['category'] = get_term_by( 'name', $r['category_name'], 'link_category' ) ) {
     210        $r['category'] = get_term_by( 'name', $r['category_name'], 'link_category' );
     211        if ( $r['category'] ) {
    208212            $r['category'] = $r['category']->term_id;
    209213        } else {
Note: See TracChangeset for help on using the changeset viewer.