Ticket #2215 (closed defect (bug): fixed)

Opened 3 years ago

Last modified 2 years ago

previous_post_link and next_post_link appear to be faulty

Reported by: denyerec Assigned to: anonymous
Priority: normal Milestone:
Component: General Version: 2.0.3
Severity: normal Keywords: template output links bg|has-patch
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

2215.diff (5.6 kB) - added by davidhouse on 01/05/06 21:00:22.
2215.2.diff (2.8 kB) - added by davidhouse on 01/05/06 21:02:00.
Oops, my fixing of another bug accidentally slipped into the first patch. Use this instead :)

Change History

01/05/06 21:00:22 changed by davidhouse

  • attachment 2215.diff added.

01/05/06 21:02:00 changed by davidhouse

  • attachment 2215.2.diff added.

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

01/05/06 21:02:42 changed by davidhouse

  • keywords changed from template output links to template output links bg|has-patch.

01/05/06 21:05:40 changed by davidhouse

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

02/09/06 08:26:33 changed by matt

  • status changed from new to closed.
  • resolution set to fixed.

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

06/18/06 17:17:17 changed by ReDirEct1

  • status changed from closed to reopened.
  • version changed from 2.0 to 2.0.3.
  • resolution deleted.

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.

06/19/06 07:36:35 changed by skeltoac

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?

03/20/07 10:30:18 changed by Nazgul

  • status changed from reopened to closed.
  • resolution set to fixed.

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.