Skip to content

Commit 27175dd

Browse files
committed
Merge branch 'release/5.3.1'
2 parents 48a88e2 + 3ecdc05 commit 27175dd

4 files changed

Lines changed: 31 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v5.3.1
2+
## 12/23/2025
3+
4+
1. [](#new)
5+
* Added a new `resetStates()` method to clear memory manually
6+
* Added new `shortcode_force_frontend` twig variable to force frontend processing
7+
18
# v5.3.0
29
## 08/25/2025
310

blueprints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Shortcode Core
22
slug: shortcode-core
33
type: plugin
4-
version: 5.3.0
4+
version: 5.3.1
55
description: "This plugin provides the core functionality for shortcode plugins"
66
icon: code
77
author:

classes/plugin/ShortcodeManager.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,26 @@ public function resetObjects()
145145
$this->objects = [];
146146
}
147147

148+
/**
149+
* reset the states
150+
*/
151+
public function resetStates()
152+
{
153+
$this->states = [];
154+
}
155+
156+
/**
157+
* Reset all accumulated state (objects, assets, states).
158+
* Useful for batch processing scenarios like search indexing
159+
* where memory needs to be freed between pages.
160+
*/
161+
public function resetAll()
162+
{
163+
$this->objects = [];
164+
$this->assets = [];
165+
$this->states = [];
166+
}
167+
148168
/**
149169
* returns the current handler container object
150170
*

shortcode-core.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ public function onPluginsInitialized()
5757
{
5858
$this->config = $this->grav['config'];
5959

60+
$forceFrontend = (bool)($this->grav['shortcode_force_frontend'] ?? false);
61+
6062
// don't continue if this is admin and plugin is disabled for admin
61-
if (!$this->config->get('plugins.shortcode-core.active_admin') && $this->isAdmin()) {
63+
if (!$forceFrontend && !$this->config->get('plugins.shortcode-core.active_admin') && $this->isAdmin()) {
6264
return;
6365
}
6466

0 commit comments

Comments
 (0)