AddThis.php
732 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
<?php
/*
Plugin Name: Add This + Facebook Like
*/
namespace Tz\WordPress\Tools\AddThis;
use Tz\WordPress\Tools;
const OPTION_NAME = "addthis_pl";
call_user_func(function() {
Vars::$options = new Tools\WP_Option(OPTION_NAME);
Tools\add_shortcodes(__NAMESPACE__ . '\ShortCodes');
if (is_admin()) {
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'Settings.php');
}
});
class ShortCodes {
public static function addthis() {
ob_start();
include('views/view.php');
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
class Vars {
/**
* WordPress option for this module
* @type WP_Option
*/
public static $options;
}
?>