[wp-trac] [WordPress Trac] #38133: Core widget fields fail to render value of "0" when empty() checks are used

WordPress Trac noreply at wordpress.org
Mon Oct 31 11:39:55 UTC 2016


#38133: Core widget fields fail to render value of "0" when empty() checks are used
---------------------------+-----------------------------
 Reporter:  hardeepasrani  |       Owner:  SergeyBiryukov
     Type:  defect (bug)   |      Status:  reviewing
 Priority:  normal         |   Milestone:  4.7
Component:  Widgets        |     Version:  2.6
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  administration
---------------------------+-----------------------------

Comment (by joshcanhelp):

 If it's helpful ... I can confirm the original issue and that the patch
 fixes it.

 I also agree with @SergeyBiryukov that if we're changing this, it should
 match the code standards. I created a new patch using WP coding standards,
 removing unnecessary isset() checks, and setting the $title var
 consistently. I also changed the $instance['filter'] check in class-wp-
 widget-text.php back to empty() since that's just a yes/no. Some of the
 spacing changes unrelated to the edits here made this a little tougher to
 review, FYI.

 One thing though ... in the RSS widget, I noticed that the behavior there
 is a little buggy. If I set a title, it's overridden on output with the
 feed name, which seems to me like the wrong thing to do. It's pretty clear
 what's going wrong (L:71-81 in the attached patched version) but feels
 like it should be in a different ticket. Thoughts?

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


More information about the wp-trac mailing list