Opened 9 years ago
Closed 5 years ago
#39378 closed enhancement (fixed)
Allow passing custom class to the post pagination functions
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Themes | 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 (2)
Change History (10)
This ticket was mentioned in Slack in #core by noisysocks. View the logs.
5 years ago
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
5 years ago
Note: See
TracTickets for help on using
tickets.
@jfarthing84 this came up in a bug scrub today - looks like a worthwhile addition, but the patch no longer applies cleanly. Are you able to update it against trunk?