WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/02/2019 11:41:16 PM (17 months 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/nav-menu-template.php

    r44966 r45590  
    117117
    118118    // Get the nav menu based on the theme_location
    119     if ( ! $menu && $args->theme_location && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) ) {
     119    $locations = get_nav_menu_locations();
     120    if ( ! $menu && $args->theme_location && $locations && isset( $locations[ $args->theme_location ] ) ) {
    120121        $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] );
    121122    }
     
    125126        $menus = wp_get_nav_menus();
    126127        foreach ( $menus as $menu_maybe ) {
    127             if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) {
     128            $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) );
     129            if ( $menu_items ) {
    128130                $menu = $menu_maybe;
    129131                break;
     
    158160    }
    159161
    160     $nav_menu = $items = '';
     162    $nav_menu = '';
     163    $items    = '';
    161164
    162165    $show_container = false;
     
    182185    _wp_menu_item_classes_by_context( $menu_items );
    183186
    184     $sorted_menu_items = $menu_items_with_children = array();
     187    $sorted_menu_items        = array();
     188    $menu_items_with_children = array();
    185189    foreach ( (array) $menu_items as $menu_item ) {
    186190        $sorted_menu_items[ $menu_item->menu_order ] = $menu_item;
Note: See TracChangeset for help on using the changeset viewer.