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

See #30799.

Built from https://develop.svn.wordpress.org/trunk@30982


git-svn-id: http://core.svn.wordpress.org/trunk@30968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2014-12-20 22:47:22 +00:00
parent 2dbd0d0a8f
commit 5eb5afac34
15 changed files with 56 additions and 25 deletions

View File

@@ -1438,7 +1438,6 @@ function wp_get_archives( $args = '' ) {
$key = "wp_get_archives:$key:$last_changed";
if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
$results = $wpdb->get_results( $query );
$cache[ $key ] = $results;
wp_cache_set( $key, $results, 'posts' );
}
if ( $results ) {
@@ -1657,6 +1656,8 @@ function get_calendar($initial = true, $echo = true) {
<tbody>
<tr>';
$daywithpost = array();
// Get days with posts
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'
@@ -1666,8 +1667,6 @@ function get_calendar($initial = true, $echo = true) {
foreach ( (array) $dayswithposts as $daywith ) {
$daywithpost[] = $daywith[0];
}
} else {
$daywithpost = array();
}
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false)