Opened 21 months ago
Last modified 18 months ago
#18613 new enhancement
get_adjacent_post() doesn't find private posts
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
The status is always 'publish'.
Attachments (2)
Change History (8)
SergeyBiryukov — 21 months ago
comment:1
SergeyBiryukov — 21 months ago
- Keywords has-patch added
comment:3
in reply to:
↑ 2
SergeyBiryukov — 21 months ago
- Keywords needs-patch added; has-patch removed
Replying to scribu:
However, we don't want users without the 'read_private_posts' capability in on these posts.
Right, totally missed that.
SergeyBiryukov — 21 months ago
comment:4
SergeyBiryukov — 21 months ago
- Keywords has-patch added; needs-patch removed
I'll look into using WP_Query in #17807.
Meanwhile, 18613.2.patch uses get_private_posts_cap_sql().
Hi Sergey,
the second patch did fix my issue with previous_post_link & next_post_link when the posts were private
but now I got this error constantly :
Warning: Cannot modify header information - headers already sent by (output started at link-template.php:2) in pluggable.php on line 897
when updating a post (thought the post would be successfully updated) or when entering a wrong url (no 404 page coming up)
and also when I try to simply log to wp-admin
so I had to put back my old link-template.php
I'm using WordPress 3.1.4 (cannot update as client host doesn't have php5)

You're a machine. :)
However, we don't want users without the 'read_private_posts' capability in on these posts.
Another reason why I think we should creatively leverage WP_Query.
Related: #17807