mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 03:16:11 +01:00
What happened is that pages added by plugins in the admin get counted as normal site pages. Counting only routable and modular pages solves the issue without messing with iterating over page types added by plugins
This commit is contained in:
@@ -384,6 +384,19 @@ class Admin
|
||||
}
|
||||
return $routes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the pages
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function countPages()
|
||||
{
|
||||
$routable = $this->grav['pages']->all()->routable();
|
||||
$modular = $this->grav['pages']->all()->modular();
|
||||
|
||||
return count($routable) + count($modular);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get All template types
|
||||
|
||||
Reference in New Issue
Block a user