Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in wp_count_attachments().
Browse files Browse the repository at this point in the history
Follow-up to [54255].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

git-svn-id: https://develop.svn.wordpress.org/trunk@59567 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Dec 31, 2024
1 parent 2ba8433 commit 7fedfd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -3390,7 +3390,8 @@ function wp_count_attachments( $mime_type = '' ) {
);

$counts = wp_cache_get( $cache_key, 'counts' );
if ( false == $counts ) {

if ( false === $counts ) {
$and = wp_post_mime_type_where( $mime_type );
$count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type", ARRAY_A );

Expand Down

0 comments on commit 7fedfd4

Please sign in to comment.