WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#3930 closed enhancement (fixed)

get_pagenum_link() needs some love

Reported by: markjaquith Owned by: rob1n
Milestone: 2.3 Priority: low
Severity: normal Version: 2.1.2
Component: Administration Keywords: has-patch needs-testing
Focuses: Cc:

Description

get_pagenum_link() is fairly Frankenstein's Monster-ish. It isn't even using add_query_arg()

Enclosed patch is just a first attempt... I'll revisit it and clean it up, as well as address XSS-escaping.

Attachments (4)

link-template.php.diff (4.2 KB) - added by markjaquith 8 years ago.
First attempt
link-template.php.002.diff (4.2 KB) - added by markjaquith 8 years ago.
Refresh
3930.diff (4.0 KB) - added by rob1n 8 years ago.
fix.diff (1.7 KB) - added by rob1n 8 years ago.

Download all attachments as: .zip

Change History (19)

@markjaquith8 years ago

First attempt

comment:1 @ryan8 years ago

Looking good so far. It's as ugly as it is because touching it often breaks something, so watch out. :-)

@markjaquith8 years ago

Refresh

comment:2 @foolswisdom8 years ago

  • Milestone changed from 2.2 to 2.3

comment:3 @rob1n8 years ago

  • Owner changed from markjaquith to rob1n

Look at all that red...

comment:4 @rob1n8 years ago

  • Keywords has-patch needs-testing added

Patch refreshed.

@rob1n8 years ago

comment:5 @rob1n8 years ago

  • Keywords commit added; needs-testing removed
  • Status changed from new to assigned

Patch works fine for me.

comment:6 @rob1n8 years ago

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

(In [5454]) Bring get_pagenum_link() into this century. Props Mark Jaquith. fixes #3930

comment:7 @josephscott8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This breaks the 'Previous Entries' link paging for categories.

comment:8 @rob1n8 years ago

  • Status changed from reopened to new

Breaks author view too.

I think remove_query_arg( 'paged' ) is removing more than paged, but I'm going to keep digging.

comment:9 @rob1n8 years ago

  • Keywords has-patch commit removed

comment:10 @rob1n8 years ago

Nope. remove_query_arg() works fine. Still digging...

@rob1n8 years ago

comment:11 @rob1n8 years ago

  • Cc rob1n added
  • Keywords has-patch needs-testing added
  • Status changed from new to assigned

Alright, that seems to take care of it. Please test and report back.

comment:12 @rob1n8 years ago

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

(In [5481]) Fix get_pagenum_link(). fixes #3930

comment:13 @snakefoot8 years ago

Just tried this new get_pagenum_link() on a Wordpress 2.0 blog, and it works fine with everything except when doing a search where it adds /page/2/ instead of &paged=2 for the following pages.

Not sure if this is an issue for Wordpress 2.3

comment:14 @ryan8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Yep, it does funky things to paging, especially once you get to page 3.

comment:15 @rob1n8 years ago

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

(In [5610]) Fix get_pagenum_link() for query strings. fixes #3930

Note: See TracTickets for help on using tickets.