Make WordPress Core

Opened 19 years ago

Closed 19 years ago

#1252 closed defect (bug) (fixed)

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

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

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 19 years ago.
get_next+previous_link.txt (1.9 KB) - added by skippy 19 years ago.
in_same_cat.diff (7.9 KB) - added by skippy 19 years ago.

Download all attachments as: .zip

Change History (6)

#1 @skippy
19 years ago

  • Patch set to No

#2 @ryan
19 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
19 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
19 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
19 years ago

  • fixed_in_version set to 1.5.1
  • Owner changed from anonymous to rboren
  • Resolution changed from 10 to 20
  • Status changed from new to closed

@skippy
19 years ago

Note: See TracTickets for help on using tickets.