forked from cedaro/simple-image-widget
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflex-widget.php
74 lines (68 loc) · 1.78 KB
/
flex-widget.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
<?php
/**
* Flex Widget
*
* @package FlexWidget
* @author James Mann, Brady Vercher
* @copyright Copyright (c) 2015, WebCakes, Inc., Cedaro & Blazer Six, Inc.
* @license GPL-2.0+
*
* @wordpress-plugin
* Plugin Name: Flex Widget
* Plugin URI: https://github.com/WebCakes/flex-widget
* Description: A Flexible WordPress widget with templating in mind.
* Version: 1.0.1
* Author: WebCakes
* Author URI: http://www.webcakes.ca/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: flex-widget
* Domain Path: /languages
*/
/**
* Main plugin instance.
*
* @since 1.0.0
* @type Flex_Widget $flex_widget
*/
global $flex_widget;
if ( ! defined( 'FW_DIR' ) ) {
/**
* Plugin directory path.
*
* @since 1.0.0
* @type string FW_DIR
*/
define( 'FW_DIR', plugin_dir_path( __FILE__ ) );
}
/**
* Check if the installed version of WordPress supports the new media manager.
*
* @since 1.0.0
*/
function is_flex_widget_legacy() {
/**
* Whether the installed version of WordPress supports the new media manager.
*
* @since 1.0.0
*
* @param bool $is_legacy
*/
return apply_filters( 'is_flex_widget_legacy', version_compare( get_bloginfo( 'version' ), '3.4.2', '<=' ) );
}
/**
* Include functions and libraries.
*/
require_once( FW_DIR . 'includes/class-flex-widget.php' );
require_once( FW_DIR . 'includes/class-flex-widget-legacy.php' );
require_once( FW_DIR . 'includes/class-flex-widget-plugin.php' );
require_once( FW_DIR . 'includes/class-flex-widget-template-loader.php' );
/**
* Deprecated main plugin class.
*
* @since 1.0.0
*/
class Flex_Widget_Loader extends Flex_Widget_Plugin {}
// Initialize and load the plugin.
$flex_widget = new Flex_Widget_Plugin();
add_action( 'plugins_loaded', array( $flex_widget, 'load' ) );