-
Notifications
You must be signed in to change notification settings - Fork 6
/
wp-meta-verify.php
40 lines (33 loc) · 1003 Bytes
/
wp-meta-verify.php
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
<?php
/*
Plugin Name: WP Meta Verify
Plugin URI: https://w3guy.com
Description: Google and Bing webmaster verification.
Version: 1.0.0
Author: Collins Agbonghama
Author URI: https://w3guy.com
License: GPL2
*/
class WP_Meta_Verify
{
public function __construct()
{
add_action('wp_head', [$this, 'header_code']);
}
public function header_code()
{
$google_code = get_option('wpmv_google_code'); // typically retrieved from plugin settings page
$bing_code = get_option('wpmv_bing_code'); // typically retrieved from plugin settings page
echo $this->google_site_verification($google_code);
echo $this->bing_site_verification($bing_code);
}
public function google_site_verification($code)
{
return "<meta name=\"google-site-verification\" content=\"$code\">";
}
public function bing_site_verification($code)
{
return "<meta name=\"msvalidate.01\" content=\"$code\">";
}
}
new WP_Meta_Verify();