[wp-trac] [WordPress Trac] #40108: Pagination Enhancement wp_link_pages()
WordPress Trac
noreply at wordpress.org
Sun Mar 12 21:58:34 UTC 2017
#40108: Pagination Enhancement wp_link_pages()
---------------------------+------------------------------
Reporter: mshumacher | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: trunk
Severity: normal | Resolution:
Keywords: needs-testing | Focuses: template
---------------------------+------------------------------
Changes (by mshumacher):
* keywords: => needs-testing
Comment:
@dingo_bastard thanks a lot for the patch!
I would appreciate if anyone can do a basic test and see if the code works
as expected.
'''Basic test scenario:'''
1. Create a 10+ page post using either the '''<!--nextpage-->''' tag or
'''Alt+Shift+P''' keyboard shortcut
2. Open the post and inspect the resulting pagination HTML (copy it
somewhere)
3. Apply the patch;
4. Reload the page ignoring cache '''Control+Shift+R'''
5. Compare the resulting pagination HTML
(the only difference between the HTML output should be the current page
which will become wrapped in a <span> tag)
'''Advanced test scenario:'''
1. Modify the wp_link_pages() function call inside the theme loop (usually
called from content.php in the theme components folder) with the following
code:
{{{#!php
<?php
wp_link_pages( array(
'before' => '<div
class="pagination"> <p>' . __( 'Page ' ) . $page . __( ' of ' ) .
$numpages . __( ' pages' ) . '</p> <ul>',
'after' => '</ul>
</div>',
'link_before' => '<li>',
'link_after' => '</li>',
'navwidth' => 3,
'next_or_number' => 'mixed',
'separator' => ' ',
'nextpagelink' => __( 'Next' )
. ' >',
'previouspagelink' => '< ' . __(
'Previous' ),
) );
}}}
2. Navigate to a multi page page post
3. Check the pagination html section for errors
(output should be similar to the example provided in my original post)
'''Themes that call wp_link_pages() function:'''
- IXION
- Twenty Sixteen
- Twenty Fifteen
- Others^1
[^1]: Any theme is suitable for testing as long as it makes a call to the
wp_link_pages function
Martin
[https://martinshreder.com]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40108#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list