koblog/bl-plugins/canonical/plugin.php
Suleman 92600d9070
Self Closing Tags
Self Closing Tags are discourages according to W3C. Validation shows warning but it's better to not have them. Same is for  <br>
2022-09-28 00:52:06 +05:30

13 lines
336 B
PHP

<?php
class pluginCanonical extends Plugin {
public function siteHead() {
if ($GLOBALS['WHERE_AM_I'] === 'home') {
return '<link rel="canonical" href="'.DOMAIN_BASE.'">'.PHP_EOL;
} elseif ($GLOBALS['WHERE_AM_I'] === 'page') {
global $page;
return '<link rel="canonical" href="'.$page->permalink().'">'.PHP_EOL;
}
}
}