WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 11 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:

Description

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:

<?php
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 11 months ago.

Download all attachments as: .zip

Change History (2)

@jfarthing84
11 months ago

#1 @jfarthing84
11 months ago

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