Two new hooks for pages loaded from database (custom pages)

HOOK_BEFORE_PAGE_CUSTOM,
HOOK_AFTER_PAGE_CUSTOM
This commit is contained in:
slawkens
2025-05-31 22:08:28 +02:00
parent fcfe5b0dbd
commit e542e8a7ce
2 changed files with 5 additions and 1 deletions

View File

@@ -334,7 +334,7 @@ if($load_it)
$success = false;
$tmp_content = getCustomPage($page, $success);
if($success) {
if($success && $hooks->trigger(HOOK_BEFORE_PAGE_CUSTOM)) {
$content .= $tmp_content;
if(hasFlag(FLAG_CONTENT_PAGES) || superAdmin()) {
$pageInfo = getCustomPageInfo($page);
@@ -342,6 +342,8 @@ if($load_it)
'page' => array('id' => $pageInfo !== null ? $pageInfo['id'] : 0, 'hidden' => $pageInfo !== null ? $pageInfo['hidden'] : '0')
)) . $content;
}
$hooks->trigger(HOOK_AFTER_PAGE_CUSTOM);
} else {
$file = TEMPLATES . "$template_name/pages/$page.php";
if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page)) {