Make WordPress Core


Ignore:
Timestamp:
12/20/2014 10:46:53 PM (11 years ago)
Author:
wonderboymusic
Message:

For clarity, initialize some arrays that previously were only assigned via short circuit in loops.

See #30799.

File:
1 edited

Legend:

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

    r30944 r30982  
    431431
    432432    WP_Theme::sort_by_name( $themes );
     433
     434    $parents = array();
     435
    433436    foreach ( $themes as $theme ) {
    434437        $slug = $theme->get_stylesheet();
     
    470473
    471474    // Remove 'delete' action if theme has an active child
    472     if ( isset( $parents ) && array_key_exists( $current_theme, $parents ) ) {
     475    if ( ! empty( $parents ) && array_key_exists( $current_theme, $parents ) ) {
    473476        unset( $prepared_themes[ $parents[ $current_theme ] ]['actions']['delete'] );
    474477    }
Note: See TracChangeset for help on using the changeset viewer.