WordPress.org

Make WordPress Core

Ticket #27802: 27802.3.diff

File 27802.3.diff, 541 bytes (added by bobbingwide, 6 years ago)

Cast the result from wp_count_attachments() to an array

  • \wp-includes\media.php

    old new  
    24112411                                break;
    24122412                        }
    24132413                }
    24142414        }
    24152415
    24162416        $audio = $video = 0;
    2417         $counts = (array) wp_count_attachments();
     2417        $counts = wp_count_attachments();
    24182418        foreach ( $counts as $mime => $total ) {
    24192419                if ( 0 === strpos( $mime, 'audio/' ) ) {
    24202420                        $audio += (int) $total;
    24212421                } elseif ( 0 === strpos( $mime, 'video/' ) ) {
    24222422                        $video += (int) $total;
    24232423                }