Make WordPress Core

Opened 14 years ago

Last modified 9 months ago

#18613 new enhancement

get_adjacent_post() doesn't find private posts

Reported by: scribu's profile scribu Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: close
Focuses: Cc:

Description

The status is always 'publish'.

Attachments (2)

18613.patch (1.0 KB) - added by SergeyBiryukov 14 years ago.
18613.2.patch (1.2 KB) - added by SergeyBiryukov 14 years ago.

Download all attachments as: .zip

Change History (12)

#1 @SergeyBiryukov
14 years ago

  • Keywords has-patch added

#2 follow-up: @scribu
14 years ago

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

#3 in reply to: ↑ 2 @SergeyBiryukov
14 years 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.

#4 @SergeyBiryukov
14 years 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().

#5 @weirdrubikscube
13 years ago

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)

#6 @sorich87
13 years ago

  • Type changed from defect (bug) to enhancement

#7 @wonderboymusic
11 years ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to Future Release

Patch blows up

#8 @DrewAPicture
10 years ago

  • Component changed from General to Posts, Post Types
  • Keywords needs-patch added; has-patch removed

Would someone care to refresh the patch here?

#9 @chriscct7
9 years ago

  • Keywords has-patch added; needs-patch removed

#10 @tw2113
9 months ago

  • Keywords close added; needs-refresh has-patch removed

I vote that we close this one as handled. From the looks of things, private posts were begun to be included as of the commit and ticket below for WordPress 4.2.

Originally SVN Changeset and ticket:
https://core.trac.wordpress.org/changeset/31302
https://core.trac.wordpress.org/ticket/30287

Note: See TracTickets for help on using tickets.