Make WordPress Core

Changeset 28139


Ignore:
Timestamp:
04/15/2014 11:59:48 PM (11 years ago)
Author:
nacin
Message:

Cast wp_count_attachments() before iterating it to avoid a notice when items exist without a mime type.

props bobbingwide.
fixes #27802.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r28128 r28139  
    26942694
    26952695    $audio = $video = 0;
    2696     $counts = wp_count_attachments();
     2696    $counts = (array) wp_count_attachments();
    26972697    foreach ( $counts as $mime => $total ) {
    26982698        if ( 0 === strpos( $mime, 'audio/' ) ) {
Note: See TracChangeset for help on using the changeset viewer.