custom-sidebars
Last commit date
css
8 years ago
img
9 years ago
inc
8 years ago
js
8 years ago
lang
8 years ago
views
8 years ago
customsidebars.php
8 years ago
license.txt
10 years ago
readme.txt
8 years ago
customsidebars.php
119 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.0.9 |
| 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 | Author - Javier Marquez (http://arqex.com/) |
| 16 | Contributor - Philipp Stracker (Incsub) |
| 17 | This program is free software; you can redistribute it and/or modify |
| 18 | it under the terms of the GNU General Public License (Version 2 - GPLv2) as published by |
| 19 | the Free Software Foundation. |
| 20 | |
| 21 | This program is distributed in the hope that it will be useful, |
| 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 | GNU General Public License for more details. |
| 25 | |
| 26 | You should have received a copy of the GNU General Public License |
| 27 | along with this program; if not, write to the Free Software |
| 28 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 29 | */ |
| 30 | |
| 31 | /* |
| 32 | This plugin was originally developed by Javier Marquez. |
| 33 | http://arqex.com/ |
| 34 | */ |
| 35 | |
| 36 | function inc_sidebars_init() { |
| 37 | if ( class_exists( 'CustomSidebars' ) ) { |
| 38 | return false; |
| 39 | } |
| 40 | |
| 41 | $plugin_dir = dirname( __FILE__ ); |
| 42 | $plugin_dir_rel = dirname( plugin_basename( __FILE__ ) ); |
| 43 | $plugin_url = plugin_dir_url( __FILE__ ); |
| 44 | |
| 45 | define( 'CSB_PLUGIN', __FILE__ ); |
| 46 | define( 'CSB_IS_PRO', false ); |
| 47 | define( 'CSB_LANG_DIR', $plugin_dir_rel . '/lang/' ); |
| 48 | define( 'CSB_VIEWS_DIR', $plugin_dir . '/views/' ); |
| 49 | define( 'CSB_INC_DIR', $plugin_dir . '/inc/' ); |
| 50 | define( 'CSB_JS_URL', $plugin_url . 'js/' ); |
| 51 | define( 'CSB_CSS_URL', $plugin_url . 'css/' ); |
| 52 | define( 'CSB_IMG_URL', $plugin_url . 'img/' ); |
| 53 | |
| 54 | // Include function library. |
| 55 | $modules[] = CSB_INC_DIR . 'external/wpmu-lib/core.php'; |
| 56 | $modules[] = CSB_INC_DIR . 'class-custom-sidebars.php'; |
| 57 | |
| 58 | $modules[] = CSB_INC_DIR . 'external/wdev-frash/module.php'; |
| 59 | |
| 60 | |
| 61 | |
| 62 | // Free-version configuration - no drip campaign yet... |
| 63 | $cta_label = false; |
| 64 | $drip_param = false; |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | foreach ( $modules as $path ) { |
| 70 | if ( file_exists( $path ) ) { require_once $path; } |
| 71 | } |
| 72 | |
| 73 | // Register the current plugin, for pro and free plugins! |
| 74 | do_action( |
| 75 | 'wdev-register-plugin', |
| 76 | /* Plugin ID */ plugin_basename( __FILE__ ), |
| 77 | /* Plugin Title */ 'CustomSidebars', |
| 78 | /* https://wordpress.org */ '/plugins/custom-sidebars/', |
| 79 | /* Email Button CTA */ $cta_label, |
| 80 | /* getdrip Plugin param */ $drip_param |
| 81 | ); |
| 82 | |
| 83 | // Initialize the plugin |
| 84 | CustomSidebars::instance(); |
| 85 | } |
| 86 | |
| 87 | inc_sidebars_init(); |
| 88 | |
| 89 | |
| 90 | if ( ! class_exists( 'CustomSidebarsEmptyPlugin' ) ) { |
| 91 | class CustomSidebarsEmptyPlugin extends WP_Widget { |
| 92 | public function __construct() { |
| 93 | parent::__construct( false, $name = 'CustomSidebarsEmptyPlugin' ); |
| 94 | } |
| 95 | public function form( $instance ) { |
| 96 | //Nothing, just a dummy plugin to display nothing |
| 97 | } |
| 98 | public function update( $new_instance, $old_instance ) { |
| 99 | //Nothing, just a dummy plugin to display nothing |
| 100 | } |
| 101 | public function widget( $args, $instance ) { |
| 102 | echo ''; |
| 103 | } |
| 104 | } //end class |
| 105 | } //end if class exists |
| 106 | |
| 107 | |
| 108 | // Translation. |
| 109 | function inc_sidebars_init_translation() { |
| 110 | if ( defined( 'CSB_LANG_DIR' ) ) { |
| 111 | load_plugin_textdomain( |
| 112 | 'custom-sidebars', |
| 113 | false, |
| 114 | CSB_LANG_DIR |
| 115 | ); |
| 116 | } |
| 117 | } |
| 118 | add_action( 'plugins_loaded', 'inc_sidebars_init_translation' ); |
| 119 |