Add an example of the ADD_HEADER_TAG hook usage

This commit is contained in:
Cédric Anne 2024-06-19 16:07:33 +02:00
parent bcdae86820
commit 0070c3cfe3

View File

@ -180,6 +180,26 @@ function plugin_init_example() {
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['example'] = 'example.js'; $PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['example'] = 'example.js';
$PLUGIN_HOOKS[Hooks::ADD_CSS]['example'] = 'example.css'; $PLUGIN_HOOKS[Hooks::ADD_CSS]['example'] = 'example.css';
// Add specific tags to the header
$PLUGIN_HOOKS[Hooks::ADD_HEADER_TAG]['example'] = [
[
'tag' => 'meta',
'properties' => [
'name' => 'robots',
'content' => 'noindex, nofollow',
]
],
[
'tag' => 'link',
'properties' => [
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'The company RSS feed',
'href' => 'https://example.org/feed.xml',
]
],
];
// request more attributes from ldap // request more attributes from ldap
//$PLUGIN_HOOKS['retrieve_more_field_from_ldap']['example']="plugin_retrieve_more_field_from_ldap_example"; //$PLUGIN_HOOKS['retrieve_more_field_from_ldap']['example']="plugin_retrieve_more_field_from_ldap_example";