WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #38133


Ignore:
Timestamp:
09/22/2016 08:16:00 PM (5 years ago)
Author:
westonruter
Comment:

@hardeepasrani good catch. Yes, the isset( $variable) && $variable !== '' check would be better over using ! empty( $variable ). (Note !== instead of !=.)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #38133

    • Property Keywords needs-patch added
    • Property Milestone changed from Awaiting Review to Future Release
    • Property Version changed from trunk to 2.6
    • Property Summary changed from Widget output empty if input is zero to Default widget title used if instance title is "0"
  • Ticket #38133 – Description

    initial v1  
    1 If you put a single zero 0 in default widgets, it won't output any thing. You can try putting a 0 in any widget title or content. It works if you put 00 or anything else.
     1If you put a single zero 0 as the title in default widgets, it won't output any thing. You can try putting a 0 in any widget title or content. It works if you put 00 or anything else.
    22
    33The reason being our use of `empty( $variable )` and `! empty( $variable )` in the default widgets. `empty` returns FALSE if var exists and has a non-empty, non-zero value.