Make WordPress Core

Opened 22 years ago

Closed 22 years ago

#1252 closed defect (bug) (fixed)

patch for next_post() and previous_post() to honor "same_category" restriction

Reported by: skippy Owned by: ryan
Priority: normal Milestone:
Component: Template Version: 1.5
Severity: trivial Keywords:
Cc: Focuses:

Description

The attached patch proposed to fix next_post() and previous_post() to allow them to be limited to the current post's category (/ categories).

Attachments (3)

diff.txt​ (1.6 KB ) - added by skippy 22 years ago.
get_next+previous_link.txt​ (1.9 KB ) - added by skippy 22 years ago.
in_same_cat.diff​ (7.9 KB ) - added by skippy 22 years ago.

Download all attachments as: .zip

Change History (6)

#1 @skippy
22 years ago

  • Patch → No

#2 @ryan
22 years ago

next_post() and previous_post() are deprecated in favor of next_post_link() and previous_post_link(). This change needs to be made in get_next_post() and get_previous_post(). next_post() and previous_post() can be updated to use get_next_post() and get_previous_post().

#3 @skippy
22 years ago

get_next+previous_link.txt is a revised patch against get_next_post and get_previous_post, to constrain post selection to the current category.

#4 @ryan
22 years ago

Cool. Updated patch to latest SVN. Used get_the_category() to get the list of categories so that we make use of the cache. Updated previous_post() and next_post() to use get_previous_post() and get_next_post().

#5 @ryan
22 years ago

  • fixed_in_version → 1.5.1
  • Owner changed from anonymous to rboren
  • Resolution 10 → 20
  • Status new → closed
Note: See TracTickets for help on using tickets.