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

See #30799.


git-svn-id: https://develop.svn.wordpress.org/trunk@30982 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-12-20 22:46:53 +00:00
parent 91dcf8796b
commit 218dd4fd6b
15 changed files with 56 additions and 25 deletions
+7 -4
View File
@@ -1289,11 +1289,14 @@ function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = ''
if ( empty( $terms ) )
return false;
$links = array();
foreach ( $terms as $term ) {
$link = get_term_link( $term, $taxonomy );
if ( is_wp_error( $link ) )
if ( is_wp_error( $link ) ) {
return $link;
$term_links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>';
}
$links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>';
}
/**
@@ -1304,9 +1307,9 @@ function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = ''
*
* @since 2.5.0
*
* @param array $term_links An array of term links.
* @param array $links An array of term links.
*/
$term_links = apply_filters( "term_links-$taxonomy", $term_links );
$term_links = apply_filters( "term_links-$taxonomy", $links );
return $before . join( $sep, $term_links ) . $after;
}