GMMediaTags.class.php
11 years ago
GMMediaTags.js
10 years ago
GMMediaTagsAdmin.class.php
10 years ago
options.php
9 years ago
types.php
8 years ago
GMMediaTags.class.php
98 lines
| 1 | <?php |
| 2 | /** |
| 3 | * GMMediaTags class |
| 4 | * |
| 5 | * @package GMMediaTags |
| 6 | * @author Giuseppe Mazzapica |
| 7 | * |
| 8 | */ |
| 9 | class GMMediaTags { |
| 10 | |
| 11 | |
| 12 | /** |
| 13 | * Class version |
| 14 | * |
| 15 | * @since 0.1.0 |
| 16 | * |
| 17 | * @access protected |
| 18 | * |
| 19 | * @var string |
| 20 | */ |
| 21 | protected static $version = '0.1.1'; |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | /** |
| 27 | * Prevent register method from run more than one time. |
| 28 | * |
| 29 | * @since 0.1.0 |
| 30 | * |
| 31 | * @access protected |
| 32 | * |
| 33 | * @var bool |
| 34 | */ |
| 35 | protected static $done = false; |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | /** |
| 41 | * Constructor. Doing nothing |
| 42 | * |
| 43 | * @since 0.1.0 |
| 44 | * |
| 45 | * @access public |
| 46 | * @return null |
| 47 | * |
| 48 | */ |
| 49 | function __construct() { |
| 50 | _doing_it_wrong( 'GMMediaTags::__construct', 'GMMediaTags Class is intented to be used statically.' ); |
| 51 | } |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | /** |
| 57 | * Initialize the plugin. Run on 'after_setup_theme' hook |
| 58 | * |
| 59 | * @since 0.1.0 |
| 60 | * |
| 61 | * @access public |
| 62 | * @return null |
| 63 | * |
| 64 | */ |
| 65 | static function init() { |
| 66 | |
| 67 | if ( ! defined('GMMEDIATAGSPATH') ) die(); |
| 68 | |
| 69 | add_action('init', array(__CLASS__, 'register'), 999 ); |
| 70 | add_action('admin_init', array(__CLASS__, 'admin_init') ); |
| 71 | |
| 72 | } |
| 73 | |
| 74 | |
| 75 | static function register() { |
| 76 | |
| 77 | self::$done = true; |
| 78 | |
| 79 | } |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | /** |
| 85 | * Add the action for backend. Run on 'admin_init' hook |
| 86 | * |
| 87 | * @since 0.1.0 |
| 88 | * |
| 89 | * @access public |
| 90 | * @return null |
| 91 | * |
| 92 | */ |
| 93 | static function admin_init() { |
| 94 | require( GMMEDIATAGSPATH . 'includes/GMMediaTagsAdmin.class.php'); |
| 95 | GMMediaTagsAdmin::init(); |
| 96 | } |
| 97 | |
| 98 | } |