-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathwp_canvas_nest.php
60 lines (50 loc) · 1.64 KB
/
wp_canvas_nest.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/*
Plugin Name: Canvas-Nest.js
Plugin URI: https://github.com/aTool-org/canvas-nest-for-wp
Description: [正版]A wordpress plugin for canvas-nest.js | 一个很炫酷网页背景效果(canvas-nest.js)的wordpress插件。
Version: 1.0.1
Author: aTool.org
Author URI: http://www.aTool.org/
License: MIT
*/
if(!class_exists('WP_Canvas_Nest')) {
class WP_Canvas_Nest {
/**
* Construct the plugin object
*/
public function __construct() {
// Initialize Settings
require_once(sprintf("%s/settings.php", dirname(__FILE__)));
$WP_Canvas_Nest_Settings = new WP_Canvas_Nest_Settings();
$plugin = plugin_basename(__FILE__);
add_filter("plugin_action_links_$plugin", array( $this, 'plugin_settings_link' ));
} // END public function __construct
/**
* Activate the plugin
*/
public static function activate() {
// Do nothing
} // END public static function activate
/**
* Deactivate the plugin
*/
public static function deactivate() {
// Do nothing
} // END public static function deactivate
// Add the settings link to the plugins page
function plugin_settings_link($links) {
$settings_link = '<a href="options-general.php?page=WP_Canvas_Nest">Settings</a>';
array_unshift($links, $settings_link);
return $links;
}
} // END class WP_Canvas_Nest
} // END if(!class_exists('WP_Canvas_Nest'))
if(class_exists('WP_Canvas_Nest'))
{
// Installation and uninstallation hooks
register_activation_hook(__FILE__, array('WP_Canvas_Nest', 'activate'));
register_deactivation_hook(__FILE__, array('WP_Canvas_Nest', 'deactivate'));
// instantiate the plugin class
$WP_Canvas_Nest = new WP_Canvas_Nest();
}