[wp-trac] [WordPress Trac] #38241: Correct the docblock description for is_single()
WordPress Trac
noreply at wordpress.org
Thu Oct 6 00:14:04 UTC 2016
#38241: Correct the docblock description for is_single()
----------------------------+---------------------------------------
Reporter: johnbillion | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Themes | Version: 3.1
Severity: normal | Keywords: needs-patch needs-testing
Focuses: docs, template |
----------------------------+---------------------------------------
The docblock description for `is_single()` states:
> Is the query for an existing single post?
>
> Works for any post type, except attachments and pages
It appears that the "Works for" phrase is incorrect and has been for the
last six years (since [16830]) because `is_single()` returns true for
attachment views. Either that, or the function's behaviour changed at some
point before its tests were introduced.
Tests for `is_single()` on an attachment view have been in place for at
least three years (since [25002]).
Originally reported by @danburzo in Slack.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38241>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list