-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopular-content.php
More file actions
109 lines (96 loc) · 2.39 KB
/
popular-content.php
File metadata and controls
109 lines (96 loc) · 2.39 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
/**
* Popular Content
*
* A simple Popular Content plugin
*
* @package popular-content
* @author Carl Hughes <carl.hughes@wiredmedia.co.uk>
* @license GPL-2.0+
* @link http://wiredmedia.co.uk
* @copyright 11-19-2013 Wired Media
*
* @wordpress-plugin
* Plugin Name: Popular Content
* Plugin URI: http://wiredmedia.co.uk
* Description: A simple Popular Content plugin
* Version: 1.0.0
* Author: Carl Hughes
* Author URI: http://wiredmedia.co.uk
* Text Domain: popular-content-locale
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Domain Path: /lang
*/
namespace WiredMedia\PopularContentPlugin;
// TODO: think about hooking this in to jetpack stats instead of trying to track page views ourselves
// If this file is called directly, abort.
if (!defined("WPINC")) {
die;
}
/**
* Plugin, used for retreiving global variables.
*
*/
class Plugin {
/**
* Plugin version, used for cache-busting of style and script file references.
*
* @since 1.0.0
*
* @var string
*/
public $version = "1.0.0";
/**
* The main plugin file
*
* @since 1.0.0
*
* @var string
*/
public $main_file = "popular-content/popular-content.php";
/**
* Unique identifier for your plugin.
*
* Use this value (not the variable name) as the text domain when internationalizing strings of text. It should
* match the Text Domain file header in the main plugin file.
*
* @since 1.0.0
*
* @var string
*/
public $slug = "popular-content";
/**
* Unique identifier for count meta_key.
*
* @since 1.0.0
*
* @var string
*/
public $count_key = 'wired_post_views_count';
/**
* Instance of this class.
*
* @since 1.0.0
*
* @var object
*/
protected static $instance = null;
/**
* Return an instance of this class.
*
* @since 1.0.0
*
* @return object A single instance of this class.
*/
public static function get_instance() {
// If the single instance hasn"t been set, set it now.
if (null == self::$instance) {
self::$instance = new self;
}
return self::$instance;
}
}
foreach (glob(plugin_dir_path(__FILE__) . 'lib/*.php') as $file) {
require_once($file);
}