PluginProbe ʕ •ᴥ•ʔ
Custom Sidebars – Dynamic Sidebar Classic Widget Area Manager / 3.2.4
Custom Sidebars – Dynamic Sidebar Classic Widget Area Manager v3.2.4
trunk 2.1.2.0 3.0.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3 3.31 3.32 3.35 3.36 3.37 3.38
custom-sidebars / customsidebars.php
custom-sidebars Last commit date
assets 5 years ago inc 5 years ago languages 5 years ago views 5 years ago customsidebars.php 5 years ago license.txt 5 years ago readme.txt 5 years ago
customsidebars.php
144 lines
1 <?php
2 /**
3 * Plugin Name: Custom Sidebars
4 * Plugin URI: https://wordpress.org/plugins/custom-sidebars/
5 * Description: Allows you to create widgetized areas and custom sidebars. Replace whole sidebars or single widgets for specific posts and pages.
6 * Version: 3.2.4
7 * Author: WPMU DEV
8 * Author URI: http://premium.wpmudev.org/
9 * Textdomain: custom-sidebars
10 * WDP ID: 910520
11 */
12
13 /*
14 Copyright Incsub (http://incsub.com)
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License (Version 2 - GPLv2) as published by
18 the Free Software Foundation.
19
20 This program is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 */
29
30 /*
31 This plugin was originally developed by Javier Marquez.
32 http://arqex.com/
33 */
34
35 function inc_sidebars_init() {
36 if ( class_exists( 'CustomSidebars' ) ) {
37 return;
38 }
39
40 /**
41 * Do not load plugin when saving file in WP Editor
42 */
43 if ( isset( $_REQUEST['action'] ) && 'edit-theme-plugin-file' == $_REQUEST['action'] ) {
44 return;
45 }
46
47 /**
48 * if admin, load only on proper pages
49 */
50 if ( is_admin() && isset( $_SERVER['SCRIPT_FILENAME'] ) ) {
51 $file = basename( $_SERVER['SCRIPT_FILENAME'] );
52 $allowed = array(
53 'edit.php',
54 'admin-ajax.php',
55 'post.php',
56 'post-new.php',
57 'widgets.php',
58 );
59 /**
60 * Allowed pages array.
61 *
62 * To change where Custom Sidebars is loaded, use this filter.
63 *
64 * @since 3.2.3
65 *
66 * @param array $allowed Allowed pages list.
67 */
68 $allowed = apply_filters( 'custom_sidebars_allowed_pages_array', $allowed );
69 if ( ! in_array( $file, $allowed ) ) {
70 return;
71 }
72 }
73
74 $plugin_dir = dirname( __FILE__ );
75 $plugin_dir_rel = dirname( plugin_basename( __FILE__ ) );
76 $plugin_url = plugin_dir_url( __FILE__ );
77
78 define( 'CSB_PLUGIN', __FILE__ );
79 define( 'CSB_IS_PRO', false );
80 define( 'CSB_VIEWS_DIR', $plugin_dir . '/views/' );
81 define( 'CSB_INC_DIR', $plugin_dir . '/inc/' );
82 define( 'CSB_JS_URL', $plugin_url . 'assets/js/' );
83 define( 'CSB_CSS_URL', $plugin_url . 'assets/css/' );
84 define( 'CSB_IMG_URL', $plugin_url . 'assets/img/' );
85
86 // Include function library.
87 $modules[] = CSB_INC_DIR . 'external/wpmu-lib/core.php';
88 $modules[] = CSB_INC_DIR . 'class-custom-sidebars.php';
89
90 $modules[] = CSB_INC_DIR . 'external/wdev-frash/module.php';
91
92
93
94 // Free-version configuration - no drip campaign yet...
95 $cta_label = false;
96 $drip_param = false;
97
98
99
100
101 foreach ( $modules as $path ) {
102 if ( file_exists( $path ) ) { require_once $path; }
103 }
104
105 // Register the current plugin, for pro and free plugins!
106 do_action(
107 'wdev-register-plugin',
108 /* Plugin ID */ plugin_basename( __FILE__ ),
109 /* Plugin Title */ 'CustomSidebars',
110 /* https://wordpress.org */ '/plugins/custom-sidebars/',
111 /* Email Button CTA */ $cta_label,
112 /* getdrip Plugin param */ $drip_param
113 );
114
115 // Initialize the plugin
116 CustomSidebars::instance();
117 }
118
119 inc_sidebars_init();
120
121 if ( ! class_exists( 'CustomSidebarsEmptyPlugin' ) ) {
122 class CustomSidebarsEmptyPlugin extends WP_Widget {
123 public function __construct() {
124 parent::__construct( false, $name = 'CustomSidebarsEmptyPlugin' );
125 }
126 public function form( $instance ) {
127 //Nothing, just a dummy plugin to display nothing
128 }
129 public function update( $new_instance, $old_instance ) {
130 //Nothing, just a dummy plugin to display nothing
131 }
132 public function widget( $args, $instance ) {
133 echo '';
134 }
135 } //end class
136 } //end if class exists
137
138
139 // Translation.
140 function inc_sidebars_init_translation() {
141 load_plugin_textdomain( 'custom-sidebars', false, basename( dirname( __FILE__ ) ) . '/languages' );
142 }
143 add_action( 'plugins_loaded', 'inc_sidebars_init_translation' );
144