#24940 closed defect (bug) (fixed)
wp_link_pages() adds separator before pagination links
Reported by: | Frank Klein | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Posts, Post Types | Keywords: | has-patch commit |
Focuses: | template | Cc: |
Description
r23653 introduced a new 'separator' argument that can be passed to wp_link_pages(). According to the inline documentation, the separator is used between pagination links.
So if you call the function like this: wp_link_pages( array( 'separator' => ' > ' ) );
the expected output would be "Pages: 1 > 2 > 3", however the actual output is "Pages: > 1 > 2 > 3".
As I understand the documentation, the separator text should only be printed between the links and not before.
Attachments (6)
Change History (22)
#3
@
11 years ago
Thanks for posting the link to the IRC discussion.
I still think that removing the first separator would have made more sense. If you want to add a separator before the page links, you can easily use the before
argument.
But if you don't want to have a separator prepended, you need to filter the output via the wp_link_pages
filter, which seems like a lot of work for the desired result.
#4
@
11 years ago
- Component changed from Themes to Posts, Post Types
- Focuses template added
- Keywords 2nd-opinion added
I'd agree the initial separator is weird.
#5
@
10 years ago
- Keywords needs-refresh added; 2nd-opinion removed
- Milestone changed from Awaiting Review to 4.1
Frank, would you mind refreshing the patch with braces?
This ticket was mentioned in IRC in #wordpress-dev by obenland. View the logs.
10 years ago
#8
@
10 years ago
The issue is that themes rely on that initial separator. With the patch, there's no space between "Pages:" and the first number in both Twenty Ten and Twenty Twelve.
If two of our bundled themes rely on it, I guess there are much more in the repository that do the same.
#9
@
10 years ago
- Keywords commit removed
I obviously tested it with the wrong theme. Thanks for your feedback!
#10
@
10 years ago
24940.4.patch goes back to using a blank space before the first link in numbers
mode, and only using the separator in next
mode, when it's between the two links.
The IRC discussion: https://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2013-03-08&sort=asc#m571427