SiteVerification.php
925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace AIOSEO\Plugin\Common\Meta;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Handles the site verification meta tags.
*
* @since 4.0.0
*/
class SiteVerification {
/**
* An array of webmaster tools and their meta names.
*
* @since 4.0.0
*
* @var array
*/
private $webmasterTools = [
'google' => 'google-site-verification',
'bing' => 'msvalidate.01',
'pinterest' => 'p:domain_verify',
'yandex' => 'yandex-verification',
'baidu' => 'baidu-site-verification'
];
/**
* Returns the robots meta tag value.
*
* @since 4.0.0
*
* @return mixed The robots meta tag value or false.
*/
public function meta() {
$metaArray = [];
foreach ( $this->webmasterTools as $key => $metaName ) {
$value = aioseo()->options->webmasterTools->$key;
if ( $value ) {
$metaArray[ $metaName ] = $value;
}
}
return $metaArray;
}
}