Update plugin.php

leave verification code for main page only
This commit is contained in:
Max Kostikov 2016-05-05 13:50:47 +02:00
parent 32d4f2684a
commit bd4ca8222e
1 changed files with 6 additions and 4 deletions

View File

@ -31,13 +31,15 @@ class pluginGoogleTools extends Plugin {
public function siteHead()
{
$html = PHP_EOL.'<!-- Google Webmasters Tools -->'.PHP_EOL;
$html .= '<meta name="google-site-verification" content="'.$this->getDbField('google-site-verification').'">'.PHP_EOL;
global $Url
if(Text::isEmpty($this->getDbField('google-site-verification'))) {
if(Text::isEmpty($this->getDbField('google-site-verification')) || !($Url->whereAmI()=='home')) {
return false;
}
$html = PHP_EOL.'<!-- Google Webmasters Tools -->'.PHP_EOL;
$html .= '<meta name="google-site-verification" content="'.$this->getDbField('google-site-verification').'">'.PHP_EOL;
return $html;
}
@ -60,4 +62,4 @@ class pluginGoogleTools extends Plugin {
return $html;
}
}
}