Skip to content

Commit

Permalink
Disable Dashboard widget next/last pagination controls on last page
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejarrett committed Apr 15, 2014
1 parent 8b402ec commit f4684ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions includes/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function stream_activity_contents( $paged = 1 ) {

$total_items = count( $all_records );
$args = array(
'total_pages' => ceil( $total_items / $records_per_page ),
'total_pages' => absint( ceil( $total_items / $records_per_page ) ), // Cast as an integer, not a float
'current' => $paged,
);

Expand Down Expand Up @@ -107,10 +107,13 @@ public static function pagination( $args = array() ) {
);

$page_links = array();
$disable_first = $disable_last = '';
$disable_first = '';
$disable_last = '';

if ( 1 === $current ) {
$disable_first = ' disabled';
}

if ( $current === $total_pages ) {
$disable_last = ' disabled';
}
Expand Down

0 comments on commit f4684ea

Please sign in to comment.