Cast wp_count_attachments() before iterating it to avoid a notice when items exist without a mime type.
props bobbingwide. fixes #27802. Built from https://develop.svn.wordpress.org/trunk@28139 git-svn-id: http://core.svn.wordpress.org/trunk@27970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
37af06c565
commit
e8020e91fd
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue