#57746 closed enhancement (fixed)
bad variable name in get_previous_posts_page_link()
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | 6.1.1 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | coding-standards | Cc: |
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.
2 years ago
#1
- Keywords has-patch added
#2
@
2 years ago
- Component changed from General to Posts, Post Types
- Milestone changed from Awaiting Review to 6.2
#3
@
2 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 55364:
@SergeyBiryukov commented on PR #4093:
2 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.
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