WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

Last modified 4 years ago

#2215 closed defect (bug) (fixed)

previous_post_link and next_post_link appear to be faulty

Reported by: denyerec Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.0.3
Component: General Keywords: template output links bg|has-patch
Focuses: Cc:

Description

Extraneous variable $sqlcat on lines 267 and 300 of template-functions-links.php in the functions get_next_post and get_previous_post

The purpose of this variable is unclear, and the link generating functions do not appear to work with the exclude categories parameter. The parameter does not seem to influence the links that are generated.

EG if the following call is made from a template:

<?php previous_post_link('&laquo; %link','%title',false,3); ?>

Then category 3 links still appear and the docs indicate that they shouldn't.

Attachments (2)

2215.diff (5.6 KB) - added by davidhouse 8 years ago.
2215.2.diff (2.8 KB) - added by davidhouse 8 years ago.
Oops, my fixing of another bug accidentally slipped into the first patch. Use this instead :)

Download all attachments as: .zip

Change History (8)

davidhouse8 years ago

davidhouse8 years ago

Oops, my fixing of another bug accidentally slipped into the first patch. Use this instead :)

comment:1 davidhouse8 years ago

  • Keywords bg|has-patch added

comment:2 davidhouse8 years ago

This patch fixes everything, so you can use excluded_categories again.

comment:3 matt8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3508]) Exclude cats like we said we would, davidhouse. Fixes #2215 and fixes #2187

comment:4 ReDirEct18 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 2.0 to 2.0.3

The changeset don't work for multiple categories. If for example i use thise code:

<?php previous_post_link('<span>&laquo;</span> %link','%title',false,'4 and 10') ?>
or
<?php next_post_link(' %link <span>&raquo;</span>','%title',false,'4 and 10') ?>

only the category with 10 id it's excluded.

comment:5 skeltoac8 years ago

We have better cat handling in WP_Query now, and a patch in #2825 that makes the "1,2,3,-4,-5,-6" syntax work exactly as you'd expect it to. Why not fix up this parameter to use that?

comment:6 Nazgul7 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

This ticket has been dead for a year.

If somebody has any opinions about this issue, they can reopen it or create a new one.

closing as fixed, as this was the previous state.

Note: See TracTickets for help on using tickets.