-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin.php
More file actions
55 lines (38 loc) · 1.06 KB
/
plugin.php
File metadata and controls
55 lines (38 loc) · 1.06 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
<?php
/**
* Plugin Name: Plugin Name
* Plugin URI: http://codemypain.com
* Description: Short plugin description
* Version: 3.2
* Author: Isaac Oyelowo
* Author URI: http://isaacoyelowo.dev
* Requires at least: 3.0
* Tested up to: 4.1
*/
class Plugin_Class {
public $pluginShortName;
public function __construct () {
$this->pluginShortName = 'plugin';
$this->addActions();
$this->addFilters();
register_activation_hook( __FILE__, array( $this, 'onActivate' ) );
}
public function addActions() {
if ( is_admin() ) {
// Add only admin specific actions here
}
}
public function addFilters() {
if ( is_admin() ) {
// Add only admin specific filters here
}
}
public function onActivate() {
// Run this on plugin activation
}
public function localize() {
// Localization
load_plugin_textdomain( $this->pluginShortName , false, dirname(plugin_basename(__FILE__)). "/languages" );
}
}
$class = new Plugin_Class();