Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#2536 closed defect (bug) (fixed)

posts_nav_link inserts $sep too often

Reported by: reuben's profile Reuben Owned by: davidhouse's profile davidhouse
Milestone: Priority: normal
Severity: normal Version: 2.0.1
Component: Administration Keywords:
Focuses: Cc:


<?php posts_nav_link('&nbsp;&nbsp;&nbsp;','Previous Resu

lts','More Results') ?></div>

The proper behaviour should be to *only* insert sep if there are both previous and next results. Otherwise, sep should not be echoed.

Attachments (1)

2536.diff (2.7 KB) - added by davidhouse 16 years ago.

Download all attachments as: .zip

Change History (9)

#1 @ryan
16 years ago

Paging by posts or by days. I think our paging by days query is not smart enough to determine if there are any days left so the next link is always shown.

#2 @davidhouse
16 years ago

  • Owner changed from anonymous to davidhouse
  • Status changed from new to assigned
  • Summary changed from posts_nav_link is dumb to posts_nav_link inserts $sep too often

16 years ago

#3 @davidhouse
16 years ago

Patch attached, which:

  • Fixes the bug for both paging by dates and posts.
  • Refactors post_nav_link() and friends to use less globals.
  • Makes paging by dates smart enough to know what the maximum number of days is.

#4 @ryan
16 years ago

Maybe we should call it _max_num_pages() to denote it is a private helper function.

#5 @davidhouse
16 years ago

If you want. I thought there was a possibility of it being used elsewhere, but actually that's not very likely.

#6 @davidhouse
16 years ago

Firefox 1.0.7, Ubuntu Linux.

Nope. Still not working after Ctrl+F5'ing and manually clearing the cache through Edit -> Preferences. Same effect as above.

#7 @davidhouse
16 years ago

Nuts. that was posted on the wrong bug.

#8 @ryan
16 years ago

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

(In [3646]) Post paging rework from David House. fixes #2536

Note: See TracTickets for help on using tickets.