forked from Codeinwp/Nivo-Lightbox-jQuery
-
Notifications
You must be signed in to change notification settings - Fork 2
/
nivo-lightbox.php
123 lines (104 loc) · 2.81 KB
/
nivo-lightbox.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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
/**
* Nivo Lightbox for WordPress
*
* Use Nivo Lightbox on all WordPress images
*
* @package NL_WordPress
* @author Cliff Seal <[email protected]>
* @link http://logoscreative.co
* @copyright 2013 Logos Creative
*
* @wordpress-plugin
* Plugin Name: Nivo Lightbox for WordPress
* Plugin URI: https://github.com/logoscreative/Nivo-Lightbox
* Description: Use Nivo Lightbox on all WordPress images
* Version: 1.1.0
* Author: Cliff Seal <[email protected]>
* Author URI: http://logoscreative.co
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Plugin class.
*
* @package NL_WordPress
* @author Cliff Seal <[email protected]>
*/
class NL_WordPress {
/**
* Plugin version, used for cache-busting of style and script file references.
*
* @since 1.0.0
*
* @const string
*/
const VERSION = '1.0.0';
/**
* 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
*/
protected $plugin_slug = 'nivo-lightbox';
/**
* Instance of this class.
*
* @since 1.0.0
*
* @var object
*/
protected static $instance = null;
/**
* Slug of the plugin screen.
*
* @since 1.0.0
*
* @var string
*/
protected $plugin_screen_hook_suffix = null;
/**
* Initialize the plugin by setting localization, filters, and administration functions.
*
* @since 1.0.0
*/
private function __construct() {
add_action( 'wp_enqueue_scripts', array( $this, 'nl_enqueue_scripts' ) );
}
/**
* 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;
}
/**
* Enqueue scripts
*
* @since 1.0.0
*/
public function nl_enqueue_scripts() {
wp_register_style( 'nivo-lightbox', plugin_dir_url( __FILE__ ) . 'nivo-lightbox.min.css', array(), '1.1' );
wp_enqueue_style( 'nivo-lightbox' );
wp_register_style( 'nivo-lightbox-theme', plugin_dir_url( __FILE__ ) . 'themes/default/default.css', array(), '1.1' );
wp_enqueue_style( 'nivo-lightbox-theme' );
wp_register_script( 'nivo-lightbox', plugin_dir_url( __FILE__ ) . 'nivo-lightbox.min.js', array('jquery'), '1.1', true );
wp_enqueue_script( 'nivo-lightbox' );
wp_register_script( 'nivo-lightbox-init', plugin_dir_url( __FILE__ ) . 'nivo-lightbox-init.min.js', array('jquery'), false, true );
wp_enqueue_script( 'nivo-lightbox-init' );
}
}
NL_WordPress::get_instance();