Make WordPress Core

Opened 17 years ago

Closed 16 years ago

#6999 closed enhancement (duplicate)

New Filters: previous_posts_link_attributes and next_posts_link_attributes

Reported by: johnlamansky's profile JohnLamansky Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.5.1
Component: Template Keywords: has-patch hook filter previous_posts_link next_posts_link
Focuses: Cc:

Description

I'm attaching a patch containing some simple enhancements to the previous/next posts link functions.

  1. New "get_next_posts" and "get_previous_posts" functions (which are non-echo versions of "next_posts" and "previous_posts"). The rationale behind this is that a plain URL would probably need to be returned for PHP use more often than echo'd.
  1. New "next_posts_link" and "previous_posts_link" filters -- useful for adding class, rel, or title attributes to the previous/next post links.

Attachments (2)

link-template.php.diff (1.7 KB) - added by JohnLamansky 17 years ago.
link-template.php-2.diff (949 bytes) - added by JohnLamansky 16 years ago.
A less-convoluted way of allowing attributes; use this instead.

Download all attachments as: .zip

Change History (4)

@JohnLamansky
16 years ago

A less-convoluted way of allowing attributes; use this instead.

#1 @JohnLamansky
16 years ago

  • Milestone changed from 2.5.2 to 2.6
  • Summary changed from Improvements to previous_posts_link and next_posts_link to New Filters: previous_posts_link_attributes and next_posts_link_attributes

#2 @JohnLamansky
16 years ago

  • Milestone 2.9 deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.