[wp-trac] [WordPress Trac] #33068: get_post() returning current object if 0
WordPress Trac
noreply at wordpress.org
Mon Feb 8 23:39:50 UTC 2021
#33068: get_post() returning current object if 0
-------------------------------+-----------------------
Reporter: Rahe | Owner: audrasjb
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 5.7
Component: Posts, Post Types | Version: 3.5
Severity: normal | Resolution:
Keywords: has-patch | Focuses: docs
-------------------------------+-----------------------
Comment (by peterwilsoncc):
@audrasjb That reads well to me, in [attachment:"33068.diff"] I've made a
minor edit:
* Moved default value to end of parameter definition, as that seems to be
standard
* Added a note about all falsey values returning the current global post,
`get_post( [] )` for example.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33068#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list