mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 10:56:08 +01:00
Fix #390 Incorrect number of pages being displayed
This commit is contained in:
@@ -75,6 +75,11 @@ class Admin
|
||||
*/
|
||||
protected $gpm;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $pages_count;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
@@ -404,9 +409,13 @@ class Admin
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function countPages()
|
||||
public function pagesCount()
|
||||
{
|
||||
return count($this->grav['pages']->all());
|
||||
if (!$this->pages_count) {
|
||||
$this->pages_count = count($this->grav['pages']->all());
|
||||
}
|
||||
|
||||
return $this->pages_count;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user