[wp-trac] [WordPress Trac] #57746: bad variable name in get_previous_posts_page_link()

WordPress Trac noreply at wordpress.org
Fri Feb 17 06:44:34 UTC 2023


#57746: bad variable name in get_previous_posts_page_link()
------------------------------+-----------------------------
 Reporter:  dalirajab         |      Owner:  (none)
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  General           |    Version:  6.1.1
 Severity:  normal            |   Keywords:
  Focuses:  coding-standards  |
------------------------------+-----------------------------
 Hello !

 While i was reading **get_previous_posts_page_link()** function code:

 {{{#!php
 <?php
 function get_previous_posts_page_link() {
         global $paged;

         if ( ! is_single() ) {
                 $nextpage = (int) $paged - 1;
                 if ( $nextpage < 1 ) {
                         $nextpage = 1;
                 }
                 return get_pagenum_link( $nextpage );
         }
 }
 }}}


 my brain crashed for a while because of this line :

 {{{#!php
 $nextpage = (int) $paged - 1;
 }}}

 I'm pretty sure that the right variable name is **$previouspage** (instead
 of **$nextpage**)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57746>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list