[wp-trac] [WordPress Trac] #56499: count() used in the loop condition

WordPress Trac noreply at wordpress.org
Sun Aug 17 16:57:45 UTC 2025


#56499: count() used in the loop condition
---------------------------+-----------------------------------------------
 Reporter:  krunal265      |       Owner:  SergeyBiryukov
     Type:  defect (bug)   |      Status:  closed
 Priority:  lowest         |   Milestone:  6.9
Component:  Comments       |     Version:
 Severity:  normal         |  Resolution:  fixed
 Keywords:  needs-testing  |     Focuses:  administration, coding-standards
  has-patch                |
---------------------------+-----------------------------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60643" 60643]:
 {{{
 #!CommitTicketReference repository="" revision="60643"
 Coding Standards: Move `count()` usage in
 `wp_dashboard_recent_comments()`.

 While the rule to discourage using functions like `count()` in a loop
 condition is a recommendation/best practice rule from the `WordPress-
 Extra` ruleset and does not directly apply to WordPress core, this is
 intended as a minor readability and code clarity improvement.

 Follow-up to [10090], [17556], [20609], [26144].

 Props krunal265, johnbillion, audrasjb, dhruvang21, SergeyBiryukov.
 Fixes #56499.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56499#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list