[wp-trac] [WordPress Trac] #44162: Add is_countable() check to wp-admin/edit-form-advanced.php

WordPress Trac noreply at wordpress.org
Fri Jun 1 19:00:07 UTC 2018


#44162: Add is_countable() check to wp-admin/edit-form-advanced.php
-----------------------------+------------------------------
 Reporter:  thrijith         |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Administration   |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch close  |     Focuses:  administration
-----------------------------+------------------------------
Changes (by desrosj):

 * keywords:  has-patch => has-patch close
 * component:  Editor => Administration
 * milestone:  4.9.8 => Awaiting Review


Comment:

 Prefacing my feedback by reiterating he is_countable() function should
 only be used before counting a value where it's valid for either a
 countable or non-countable value to be passed. See
 [ticket:44123#comment:11] for a longer explanation.

 I don't think that these occurrences of `count()` should be preceded by an
 `is_countable()` check. All three functions (`get_users()`,
 `wp_get_post_revisions()`, and `get_page_templates()`) should always
 return arrays. If arrays are not returned, this is a bug and the PHP
 warning should not be suppressed.

 Also, moving this to Administration because it relates to the edit screen
 and not directly with the Editor.

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


More information about the wp-trac mailing list