#57746 closed enhancement (fixed)
bad variable name in get_previous_posts_page_link()
| Reported by: | dalirajab | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.2 |
| Component: | Posts, Post Types | Version: | 6.1.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | coding-standards |
Description
Hello !
While i was reading get_previous_posts_page_link() function code:
<?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 :
$nextpage = (int) $paged - 1;
I'm pretty sure that the right variable name is $previouspage (instead of $nextpage)
Change History (4)
This ticket was mentioned in PR #4093 on WordPress/wordpress-develop by @dalirajab.
4 years ago
#1
- Keywords has-patch added
#2
@
4 years ago
- Component General → Posts, Post Types
- Milestone Awaiting Review → 6.2
@SergeyBiryukov commented on PR #4093:
4 years ago
#4
Thanks for the PR! Merged in r55364 as part of a few other similar edits.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hello !
While i was reading get_previous_posts_page_link() function code:
{{{php
<?php
function get_previous_posts_page_link() {
}
}}}
my brain crashed for a while because of this line :
$nextpage = (int) $paged - 1;I'm pretty sure that the right variable name is $previouspage (instead of $nextpage)
Trac ticket: https://core.trac.wordpress.org/ticket/57746#ticket