[wp-trac] [WordPress Trac] #30287: Private posts skipped in single post navigation
WordPress Trac
noreply at wordpress.org
Thu Dec 4 21:03:18 UTC 2014
#30287: Private posts skipped in single post navigation
-------------------------------------------------+-------------------------
Reporter: blogan | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future
Component: Posts, Post Types | Release
Severity: normal | Version: 1.5
Keywords: needs-patch needs-unit-tests good- | Resolution:
first-bug | Focuses:
-------------------------------------------------+-------------------------
Changes (by boonebgorges):
* keywords: => needs-patch needs-unit-tests good-first-bug
* type: defect (bug) => enhancement
* version: trunk => 1.5
* component: General => Posts, Post Types
* milestone: Awaiting Review => Future Release
Comment:
> The issue is with the query in the get_adjacent_post() functions that
only allows for published posts.
Correct. The `post_status = 'publish'` clause has been hardcoded since at
least 1.5. See [1557].
> I don't know if it's as straight forward as that because there's no
logged in check and I'm fairly certain we don't want to run this altered
query for every user.
It definitely is not this straightforward, for these very reasons :) The
purpose of the 'private' post status is to hide a post from all members
but the author of the post. `WP_Query` accounts for this, but
`get_adjacent_post()` does not use `WP_Query` (see #26937). I suppose
mirroring the logic here too would be fine, but I'd like to see a patch +
unit tests.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30287#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list