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-includes/category-template.php

    r30681 r30982  
    12901290        return false;
    12911291
     1292    $links = array();
     1293
    12921294    foreach ( $terms as $term ) {
    12931295        $link = get_term_link( $term, $taxonomy );
    1294         if ( is_wp_error( $link ) )
     1296        if ( is_wp_error( $link ) ) {
    12951297            return $link;
    1296         $term_links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>';
     1298        }
     1299        $links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>';
    12971300    }
    12981301
     
    13051308     * @since 2.5.0
    13061309     *
    1307      * @param array $term_links An array of term links.
    1308      */
    1309     $term_links = apply_filters( "term_links-$taxonomy", $term_links );
     1310     * @param array $links An array of term links.
     1311     */
     1312    $term_links = apply_filters( "term_links-$taxonomy", $links );
    13101313
    13111314    return $before . join( $sep, $term_links ) . $after;
Note: See TracChangeset for help on using the changeset viewer.