[wp-trac] [WordPress Trac] #49958: Improve paginator in general-template.php

WordPress Trac noreply at wordpress.org
Mon Apr 20 11:14:52 UTC 2020


#49958: Improve paginator in general-template.php
-------------------------------+------------------------------
 Reporter:  lolitsjohnnyboy    |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:  template
-------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * focuses:  ui => template
 * component:  General => Posts, Post Types


Old description:

> I would like to add custom classes to the default paginator in the
> {{{
> general-template.php
> }}}
>  file. For that I would suggest the following change:
>
> {{{#!php
> <?php
> $page_links[] = sprintf(
>         '<a class="page-numbers %s" href="%s">%s</a>',
>         /** This filter is documented in wp-includes/general-template.php
> */
>         esc_attr( apply_filters( 'paginate_classes' ) ),
>         esc_url( apply_filters( 'paginate_links', $link ) ),
>         $args['before_page_number'] . number_format_i18n( $n ) .
> $args['after_page_number']
> );
> }}}
>
> That needs to be applied to every
> {{{
> page-numbers
> }}}
>  element and would be very helpful.

New description:

 I would like to add custom classes to the default paginator in the
 `general-template.php` file. For that I would suggest the following
 change:

 {{{#!php
 <?php
 $page_links[] = sprintf(
         '<a class="page-numbers %s" href="%s">%s</a>',
         /** This filter is documented in wp-includes/general-template.php
 */
         esc_attr( apply_filters( 'paginate_classes' ) ),
         esc_url( apply_filters( 'paginate_links', $link ) ),
         $args['before_page_number'] . number_format_i18n( $n ) .
 $args['after_page_number']
 );
 }}}

 That needs to be applied to every `page-numbers` element and would be very
 helpful.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49958#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list