Skip to content

Commit 0070c3c

Browse files
committed
Add an example of the ADD_HEADER_TAG hook usage
1 parent bcdae86 commit 0070c3c

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

setup.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,26 @@ function plugin_init_example() {
180180
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['example'] = 'example.js';
181181
$PLUGIN_HOOKS[Hooks::ADD_CSS]['example'] = 'example.css';
182182

183+
// Add specific tags to the header
184+
$PLUGIN_HOOKS[Hooks::ADD_HEADER_TAG]['example'] = [
185+
[
186+
'tag' => 'meta',
187+
'properties' => [
188+
'name' => 'robots',
189+
'content' => 'noindex, nofollow',
190+
]
191+
],
192+
[
193+
'tag' => 'link',
194+
'properties' => [
195+
'rel' => 'alternate',
196+
'type' => 'application/rss+xml',
197+
'title' => 'The company RSS feed',
198+
'href' => 'https://example.org/feed.xml',
199+
]
200+
],
201+
];
202+
183203
// request more attributes from ldap
184204
//$PLUGIN_HOOKS['retrieve_more_field_from_ldap']['example']="plugin_retrieve_more_field_from_ldap_example";
185205

0 commit comments

Comments
 (0)