From 85925b39ad93bdb0f49ca9435226d24f43fe739e Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 15 Apr 2014 23:59:48 +0000 Subject: [PATCH] Cast wp_count_attachments() before iterating it to avoid a notice when items exist without a mime type. props bobbingwide. fixes #27802. git-svn-id: https://develop.svn.wordpress.org/trunk@28139 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 012654ff3c..8154afe390 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -2693,7 +2693,7 @@ function wp_enqueue_media( $args = array() ) { } $audio = $video = 0; - $counts = wp_count_attachments(); + $counts = (array) wp_count_attachments(); foreach ( $counts as $mime => $total ) { if ( 0 === strpos( $mime, 'audio/' ) ) { $audio += (int) $total;