mirror of
https://github.com/getgrav/grav.git
synced 2026-09-03 07:33:21 +02:00
By default, add media to only pages which have been initialized in pages loop
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# v1.7.99-feature
|
||||
## mm/dd/2022
|
||||
|
||||
2. [](#improved)
|
||||
* By default, add media to only pages which have been initialized in pages loop
|
||||
|
||||
# v1.7.30
|
||||
## mm/dd/2022
|
||||
|
||||
|
||||
@@ -173,6 +173,15 @@ class Page implements PageInterface
|
||||
$this->taxonomy = [];
|
||||
$this->process = $config->get('system.pages.process');
|
||||
$this->published = true;
|
||||
$this->_loadMedia = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function enableMedia(): void
|
||||
{
|
||||
$this->_loadMedia = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1788,6 +1788,7 @@ class Pages
|
||||
{
|
||||
$directory = rtrim($directory, DS);
|
||||
$page = new Page;
|
||||
$page->enableMedia();
|
||||
|
||||
/** @var Config $config */
|
||||
$config = $this->grav['config'];
|
||||
|
||||
Reference in New Issue
Block a user