Skip to content

Add hooks: "app_page_filter" and "articles_display"

M. Dent requested to merge dentm42/core:add-page-hook into dev

hook: app_page_filter - input App::$page allows filtering of App::$page just before display.

hook: articles_display

               ['template' => 'cards.tpl', 
                'templatedir' => '',
                'items' => $items, 
                'mode' => $mode, 
                'update' => false, 
                'page_mode' => $page_mode, 
                'content' => $content,
                'title' => t('Articles'),
                'editor' => $editor,
                'page' => alt_pager($pager_total) ];

Runs just before replace_macros/get_markup_template and return of content to original caller. Allows override of template, content, editor, title, and pager. Other data is included in the call to avoid query duplication and to pass relevant inputs already gathered.

hook: htmlpurify_config

Allows changes to be made to the HTMLPurifier configuration before the HTMLPurifier class is instantiated and purify_html() returns the purified HTML. See include/text.php for the definition of purify_html() and the object passed into the hook.

Edited by M. Dent

Merge request reports