Make WordPress Core

Opened 3 years ago

Last modified 7 months ago

#39378 new enhancement

Allow passing custom class to the post pagination functions

Reported by: jfarthing84 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: General Keywords: has-patch
Focuses: Cc:
PR Number:


The functions the_posts_pagination() and get_the_posts_pagination() should accept a class to be used instead of only defaulting to .pagination.

If anyone wishes to achieve this meanwhile, it must be done with the navigation_markup_template filter, unfortunately:

function navigvation_markup_template_filter( $template, $class ) {
        if ( 'pagination' == $class ) {
                $template = str_replace( '%1$s', 'posts-pagination', $template );
        return $template;
add_filter( 'navigation_markup_template', 'navigvation_markup_template_filter', 10, 2 );

Attachments (1)

39378.patch (1.3 KB) - added by jfarthing84 3 years ago.

Download all attachments as: .zip

Change History (2)

3 years ago

#1 @jfarthing84
3 years ago

  • Keywords has-patch added
Note: See TracTickets for help on using tickets.