| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: SpiceBox |
| 4 |
Description: Enhances SpiceThemes with extra functionality. |
| 5 |
Version: 2.3.1 |
| 6 |
Author: Spicethemes |
| 7 |
Author URI: https://spicethemes.com |
| 8 |
Text Domain: spicebox |
| 9 |
*/ |
| 10 |
define( 'SPICEB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 11 |
define( 'SPICEB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 12 |
error_reporting(0); |
| 13 |
function spiceb_activate() { |
| 14 |
$theme = wp_get_theme(); // gets the current theme |
| 15 |
if ( 'SpicePress' == $theme->name || 'SpicePress Dark' == $theme->name || 'Rockers' == $theme->name || 'Content' == $theme->name || 'Certify' == $theme->name || 'Stacy' == $theme->name || 'SpicePress Child Theme' == $theme->name || 'SpicePress Child' == $theme->name){ |
| 16 |
|
| 17 |
//Alpha Color Control |
| 18 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 19 |
require_once('inc/controls/customizer-image-radio-button/image_radio_button.php'); |
| 20 |
require_once('inc/spicepress/features/feature-slider-section.php'); |
| 21 |
require_once('inc/spicepress/features/feature-service-section.php'); |
| 22 |
require_once('inc/spicepress/features/feature-portfolio-section.php'); |
| 23 |
require_once('inc/spicepress/features/feature-testimonial-section.php'); |
| 24 |
require_once('inc/spicepress/sections/spicepress-slider-section.php'); |
| 25 |
require_once('inc/spicepress/sections/spicepress-features-section.php'); |
| 26 |
require_once('inc/spicepress/sections/spicepress-portfolio-section.php'); |
| 27 |
require_once('inc/spicepress/sections/spicepress-testimonail-section.php'); |
| 28 |
require_once('inc/spicepress/customizer.php'); |
| 29 |
} |
| 30 |
|
| 31 |
if ( 'HoneyPress' == $theme->name || 'HoneyPress Child' == $theme->name || 'Radix Multipurpose' == $theme->name || 'HoneyWaves' == $theme->name || 'Bizhunt' == $theme->name || 'Tromas' == $theme->name || 'HoneyBee' == $theme->name || 'Honeypress Dark' == $theme->name ){ |
| 32 |
require_once('inc/honeypress/features/feature-slider-section.php'); |
| 33 |
require_once('inc/honeypress/features/feature-service-section.php'); |
| 34 |
require_once('inc/honeypress/features/feature-testimonial-section.php'); |
| 35 |
require_once('inc/honeypress/sections/honeypress-slider-section.php'); |
| 36 |
require_once('inc/honeypress/sections/honeypress-service-section.php'); |
| 37 |
require_once('inc/honeypress/sections/honeypress-testimonail-section.php'); |
| 38 |
require_once('inc/honeypress/customizer.php'); |
| 39 |
} |
| 40 |
if ( 'CloudPress' == $theme->name || 'CloudPress Child' == $theme->name || 'CloudPress Dark' == $theme->name || 'CloudPress Agency' == $theme->name || 'CloudPress Business' == $theme->name){ |
| 41 |
require_once('inc/cloudpress/features/feature-slider-section.php'); |
| 42 |
require_once('inc/cloudpress/features/feature-cta-section.php'); |
| 43 |
require_once('inc/cloudpress/features/feature-service-section.php'); |
| 44 |
require_once('inc/cloudpress/features/feature-funfact-section.php'); |
| 45 |
require_once('inc/cloudpress/features/feature-team-section.php'); |
| 46 |
require_once('inc/cloudpress/sections/cloudpress-slider-section.php'); |
| 47 |
require_once('inc/cloudpress/sections/cloudpress-cta-section.php'); |
| 48 |
require_once('inc/cloudpress/sections/cloudpress-service-section.php'); |
| 49 |
require_once('inc/cloudpress/sections/cloudpress-funfact-section.php'); |
| 50 |
require_once('inc/cloudpress/sections/cloudpress-team-section.php'); |
| 51 |
require_once('inc/cloudpress/customizer.php'); |
| 52 |
} |
| 53 |
|
| 54 |
if ( 'CloudPress Dark' == $theme->name || 'CloudPress Agency' == $theme->name || 'CloudPress Business' == $theme->name){ |
| 55 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 56 |
require_once('inc/cloudpress/features/feature-testimonial-section.php'); |
| 57 |
require_once('inc/cloudpress/sections/cloudpress-testimonail-section.php'); |
| 58 |
} |
| 59 |
|
| 60 |
if ( 'Chilly' == $theme->name || 'SpiceBlue' == $theme->name){ |
| 61 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 62 |
require_once('inc/spicepress/features/feature-service-section.php'); |
| 63 |
require_once('inc/spicepress/features/feature-portfolio-section.php'); |
| 64 |
require_once('inc/spicepress/features/feature-testimonial-section.php'); |
| 65 |
require_once('inc/spicepress/sections/spicepress-features-section.php'); |
| 66 |
require_once('inc/spicepress/sections/spicepress-portfolio-section.php'); |
| 67 |
require_once('inc/spicepress/sections/spicepress-testimonail-section.php'); |
| 68 |
require_once('inc/spicepress/customizer.php'); |
| 69 |
} |
| 70 |
|
| 71 |
if ( 'Innofit' == $theme->name || 'Innofit Child' == $theme->name){ |
| 72 |
|
| 73 |
|
| 74 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 75 |
|
| 76 |
|
| 77 |
if ( ! is_plugin_active( 'innofit-plus/innofit-plus.php' ) ): |
| 78 |
|
| 79 |
|
| 80 |
if ( ! function_exists( 'spiceb_innofit_customize_register' ) ) : |
| 81 |
function spiceb_innofit_customize_register($wp_customize){ |
| 82 |
|
| 83 |
|
| 84 |
if(!empty(get_theme_mod('innofit_testimonial_content'))) |
| 85 |
{ |
| 86 |
$sections_customizer_data = array('slider','services','about','testimonial','team','news','callout','contact','subscriber','wooproduct'); |
| 87 |
} |
| 88 |
else |
| 89 |
{ |
| 90 |
$sections_customizer_data = array('slider','services','about','team','news','callout','contact','subscriber','wooproduct'); |
| 91 |
} |
| 92 |
|
| 93 |
if(!empty(get_theme_mod('home_call_out_title'))) |
| 94 |
{ |
| 95 |
$sections_customizer_data = array('slider','services','about','testimonial','team','news','callout','contact','subscriber','wooproduct'); |
| 96 |
} |
| 97 |
else |
| 98 |
{ |
| 99 |
$sections_customizer_data = array('slider','services','about','team','news','contact','subscriber','wooproduct'); |
| 100 |
} |
| 101 |
|
| 102 |
|
| 103 |
if(!empty(get_theme_mod('innofit_subscribe_title'))) |
| 104 |
{ |
| 105 |
$sections_customizer_data = array('slider','services','about','testimonial','team','news','callout','contact','subscriber','wooproduct'); |
| 106 |
} |
| 107 |
else |
| 108 |
{ |
| 109 |
$sections_customizer_data = array('slider','services','about','team','news','contact','wooproduct'); |
| 110 |
} |
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh'; |
| 117 |
|
| 118 |
if (!empty($sections_customizer_data)) |
| 119 |
{ |
| 120 |
foreach($sections_customizer_data as $section_customizer_data) |
| 121 |
{ |
| 122 |
require_once('inc/innofit/customizer/'.$section_customizer_data.'-section.php'); |
| 123 |
} |
| 124 |
} |
| 125 |
$wp_customize->remove_control('header_textcolor'); |
| 126 |
|
| 127 |
} |
| 128 |
add_action( 'customize_register', 'spiceb_innofit_customize_register' ); |
| 129 |
endif; |
| 130 |
|
| 131 |
|
| 132 |
$sections_data = array('slider','services','about','testimonial','team','news','callout','contact','subscriber','wooproduct'); |
| 133 |
|
| 134 |
if (!empty($sections_data)) |
| 135 |
{ |
| 136 |
foreach($sections_data as $section_data) |
| 137 |
{ |
| 138 |
require_once('inc/innofit/sections/innofit-'.$section_data.'-section.php'); |
| 139 |
} |
| 140 |
} |
| 141 |
|
| 142 |
require_once('inc/innofit/customizer/customizer-render-callbacks.php'); |
| 143 |
require_once('inc/innofit/customizer.php'); |
| 144 |
|
| 145 |
|
| 146 |
endif; |
| 147 |
|
| 148 |
} |
| 149 |
|
| 150 |
if ( 'BusiCare' == $theme->name || 'BusiCare Child' == $theme->name || 'BusiCare Dark' == $theme->name){ |
| 151 |
|
| 152 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 153 |
|
| 154 |
if ( ! is_plugin_active( 'busicare-plus/busicare-plus.php' ) ): |
| 155 |
|
| 156 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 157 |
require_once('inc/controls/customizer-repeater/functions.php'); |
| 158 |
require ('inc/controls/customizer-text-radio/customizer-text-radio.php'); |
| 159 |
|
| 160 |
if ( ! function_exists( 'spiceb_busicare_customize_register' ) ) : |
| 161 |
function spiceb_busicare_customize_register($wp_customize){ |
| 162 |
|
| 163 |
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh'; |
| 164 |
$sections_customizer_data = array('slider','services','news','testimonial','team'); |
| 165 |
|
| 166 |
if (!empty($sections_customizer_data)) |
| 167 |
{ |
| 168 |
foreach($sections_customizer_data as $section_customizer_data) |
| 169 |
{ |
| 170 |
require_once('inc/busicare/customizer/'.$section_customizer_data.'-section.php'); |
| 171 |
} |
| 172 |
} |
| 173 |
$wp_customize->remove_control('header_textcolor'); |
| 174 |
|
| 175 |
} |
| 176 |
add_action( 'customize_register', 'spiceb_busicare_customize_register' ); |
| 177 |
endif; |
| 178 |
|
| 179 |
if ( 'BusiCare' == $theme->name || 'BusiCare Child' == $theme->name) |
| 180 |
{ |
| 181 |
$sections_data = array('slider','services','news','testimonial','team'); |
| 182 |
} |
| 183 |
else |
| 184 |
{ |
| 185 |
$sections_data = array('slider','services','news-dark','testimonial','team'); |
| 186 |
} |
| 187 |
|
| 188 |
if (!empty($sections_data)){ |
| 189 |
|
| 190 |
foreach($sections_data as $section_data){ |
| 191 |
require_once('inc/busicare/sections/busicare-'.$section_data.'-section.php'); |
| 192 |
} |
| 193 |
} |
| 194 |
|
| 195 |
require_once('inc/busicare/customizer.php'); |
| 196 |
|
| 197 |
endif; |
| 198 |
} |
| 199 |
|
| 200 |
//Spice Software |
| 201 |
if ( 'Spice Software' == $theme->name || 'Spice Software Dark' == $theme->name || 'Spice Software Child' == $theme->name){ |
| 202 |
|
| 203 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 204 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 205 |
if ( ! is_plugin_active( 'spice-software-plus/spice-software-plus.php' ) ): |
| 206 |
|
| 207 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 208 |
require_once('inc/controls/customizer-repeater/functions.php'); |
| 209 |
require ('inc/controls/customizer-text-radio/customizer-text-radio.php'); |
| 210 |
|
| 211 |
if ( ! function_exists( 'spiceb_spice_software_customize_register' ) ) : |
| 212 |
function spiceb_spice_software_customize_register($wp_customize){ |
| 213 |
|
| 214 |
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh'; |
| 215 |
$sections_customizer_data = array('slider','services','news','testimonial','team'); |
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
if (!empty($sections_customizer_data)) |
| 220 |
{ |
| 221 |
foreach($sections_customizer_data as $section_customizer_data) |
| 222 |
{ |
| 223 |
require_once('inc/spice-software/customizer/'.$section_customizer_data.'-section.php'); |
| 224 |
} |
| 225 |
} |
| 226 |
$wp_customize->remove_control('header_textcolor'); |
| 227 |
|
| 228 |
} |
| 229 |
add_action( 'customize_register', 'spiceb_spice_software_customize_register' ); |
| 230 |
endif; |
| 231 |
|
| 232 |
$sections_data = array('slider','services','news','testimonial','team'); |
| 233 |
|
| 234 |
if (!empty($sections_data)){ |
| 235 |
|
| 236 |
foreach($sections_data as $section_data){ |
| 237 |
require_once('inc/spice-software/sections/spice-software-'.$section_data.'-section.php'); |
| 238 |
} |
| 239 |
} |
| 240 |
|
| 241 |
require_once('inc/spice-software/customizer.php'); |
| 242 |
|
| 243 |
endif; |
| 244 |
} |
| 245 |
|
| 246 |
|
| 247 |
//Spiko |
| 248 |
if ( 'Spiko' == $theme->name || 'Spiko Child' == $theme->name || 'Spiko Dark' == $theme->name){ |
| 249 |
|
| 250 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 251 |
|
| 252 |
if ( ! is_plugin_active( 'spiko-plus/spiko-plus.php' ) ): |
| 253 |
|
| 254 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 255 |
require_once('inc/controls/customizer-repeater/functions.php'); |
| 256 |
require ('inc/controls/customizer-text-radio/customizer-text-radio.php'); |
| 257 |
|
| 258 |
if ( ! function_exists( 'spiceb_spiko_customize_register' ) ) : |
| 259 |
function spiceb_spiko_customize_register($wp_customize){ |
| 260 |
|
| 261 |
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh'; |
| 262 |
$sections_customizer_data = array('slider','services','testimonial','team','news'); |
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
if (!empty($sections_customizer_data)) |
| 267 |
{ |
| 268 |
foreach($sections_customizer_data as $section_customizer_data) |
| 269 |
{ |
| 270 |
require_once('inc/spiko/customizer/'.$section_customizer_data.'-section.php'); |
| 271 |
} |
| 272 |
} |
| 273 |
$wp_customize->remove_control('header_textcolor'); |
| 274 |
|
| 275 |
} |
| 276 |
add_action( 'customize_register', 'spiceb_spiko_customize_register' ); |
| 277 |
endif; |
| 278 |
|
| 279 |
$sections_data = array('slider','services','testimonial','team','news'); |
| 280 |
|
| 281 |
if (!empty($sections_data)){ |
| 282 |
|
| 283 |
foreach($sections_data as $section_data){ |
| 284 |
require_once('inc/spiko/sections/spiko-'.$section_data.'-section.php'); |
| 285 |
} |
| 286 |
} |
| 287 |
|
| 288 |
require_once('inc/spiko/customizer.php'); |
| 289 |
|
| 290 |
endif; |
| 291 |
} |
| 292 |
|
| 293 |
//WPKites |
| 294 |
if ( 'WPKites' == $theme->name || 'WPKites Child' == $theme->name || 'WPKites Dark' == $theme->name){ |
| 295 |
|
| 296 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 297 |
|
| 298 |
if ( ! is_plugin_active( 'wpkites-plus/wpkites-plus.php' ) ): |
| 299 |
|
| 300 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 301 |
require_once('inc/controls/customizer-repeater/functions.php'); |
| 302 |
require ('inc/controls/customizer-text-radio/customizer-text-radio.php'); |
| 303 |
|
| 304 |
if ( ! function_exists( 'spiceb_wpkites_customize_register' ) ) : |
| 305 |
function spiceb_wpkites_customize_register($wp_customize){ |
| 306 |
|
| 307 |
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh'; |
| 308 |
$sections_customizer_data = array('slider','services','team','news','testimonial'); |
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
if (!empty($sections_customizer_data)) |
| 313 |
{ |
| 314 |
foreach($sections_customizer_data as $section_customizer_data) |
| 315 |
{ |
| 316 |
require_once('inc/wpkites/customizer/'.$section_customizer_data.'-section.php'); |
| 317 |
} |
| 318 |
} |
| 319 |
$wp_customize->remove_control('header_textcolor'); |
| 320 |
|
| 321 |
} |
| 322 |
add_action( 'customize_register', 'spiceb_wpkites_customize_register' ); |
| 323 |
endif; |
| 324 |
|
| 325 |
$sections_data = array('slider','services','team','news','testimonial'); |
| 326 |
|
| 327 |
if (!empty($sections_data)){ |
| 328 |
|
| 329 |
foreach($sections_data as $section_data){ |
| 330 |
require_once('inc/wpkites/sections/wpkites-'.$section_data.'-section.php'); |
| 331 |
} |
| 332 |
} |
| 333 |
|
| 334 |
require_once('inc/wpkites/customizer.php'); |
| 335 |
|
| 336 |
endif; |
| 337 |
|
| 338 |
|
| 339 |
add_action( 'admin_menu', 'wpkites_starter_sites_menu',999 ); |
| 340 |
if(!function_exists('wpkites_starter_sites_menu')) { |
| 341 |
function wpkites_starter_sites_menu() { |
| 342 |
|
| 343 |
add_submenu_page( |
| 344 |
'wpkites-panel', |
| 345 |
esc_html__( 'Starer Sites', 'spicebox' ), |
| 346 |
esc_html__( 'Starer Sites', 'spicebox' ), |
| 347 |
'manage_options', |
| 348 |
'starter-sites', |
| 349 |
function() { require_once SPICEB_PLUGIN_DIR.'inc/wpkites/starter-sites/view.php'; }, |
| 350 |
2 |
| 351 |
); |
| 352 |
|
| 353 |
add_submenu_page( |
| 354 |
'wpkites-panel', |
| 355 |
esc_html__( 'Extensions', 'spicebox' ), |
| 356 |
esc_html__( 'Extensions', 'spicebox' ), |
| 357 |
'manage_options', |
| 358 |
'extensions', |
| 359 |
function() { require_once SPICEB_PLUGIN_DIR.'inc/wpkites/extensions/view.php'; }, |
| 360 |
2 |
| 361 |
); |
| 362 |
|
| 363 |
} |
| 364 |
|
| 365 |
} |
| 366 |
} |
| 367 |
|
| 368 |
//WPHester |
| 369 |
if ( 'WPHester' == $theme->name || 'WPHester Child' == $theme->name || 'WPHester Dark' == $theme->name){ |
| 370 |
|
| 371 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 372 |
|
| 373 |
if ( ! is_plugin_active( 'wphester-plus/wphester-plus.php' ) ): |
| 374 |
|
| 375 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 376 |
require_once('inc/controls/customizer-repeater/functions.php'); |
| 377 |
require ('inc/controls/customizer-text-radio/customizer-text-radio.php'); |
| 378 |
|
| 379 |
if ( ! function_exists( 'spiceb_wphester_customize_register' ) ) : |
| 380 |
function spiceb_wphester_customize_register($wp_customize){ |
| 381 |
|
| 382 |
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh'; |
| 383 |
$sections_customizer_data = array('slider','services','testimonial','team','news'); |
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
if (!empty($sections_customizer_data)) |
| 388 |
{ |
| 389 |
foreach($sections_customizer_data as $section_customizer_data) |
| 390 |
{ |
| 391 |
require_once('inc/wphester/customizer/'.$section_customizer_data.'-section.php'); |
| 392 |
} |
| 393 |
} |
| 394 |
$wp_customize->remove_control('header_textcolor'); |
| 395 |
|
| 396 |
} |
| 397 |
add_action( 'customize_register', 'spiceb_wphester_customize_register' ); |
| 398 |
endif; |
| 399 |
|
| 400 |
$sections_data = array('slider','services','testimonial','team','news'); |
| 401 |
|
| 402 |
if (!empty($sections_data)){ |
| 403 |
|
| 404 |
foreach($sections_data as $section_data){ |
| 405 |
require_once('inc/wphester/sections/wphester-'.$section_data.'-section.php'); |
| 406 |
} |
| 407 |
} |
| 408 |
|
| 409 |
require_once('inc/wphester/customizer.php'); |
| 410 |
|
| 411 |
endif; |
| 412 |
} |
| 413 |
|
| 414 |
//WPBlack |
| 415 |
if ( 'WPBlack' == $theme->name || 'WPBlack Child' == $theme->name || 'WPBlack Dark' == $theme->name){ |
| 416 |
|
| 417 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 418 |
|
| 419 |
if ( ! is_plugin_active( 'wpblack-plus/wpblack-plus.php' ) ): |
| 420 |
|
| 421 |
require_once('inc/controls/customizer-alpha-color-picker/class-spicepress-customize-alpha-color-control.php'); |
| 422 |
require_once('inc/controls/customizer-repeater/functions.php'); |
| 423 |
require ('inc/controls/customizer-text-radio/customizer-text-radio.php'); |
| 424 |
|
| 425 |
if ( ! function_exists( 'spiceb_wpblack_customize_register' ) ) : |
| 426 |
function spiceb_wpblack_customize_register($wp_customize){ |
| 427 |
|
| 428 |
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh'; |
| 429 |
$sections_customizer_data = array('slider','services','team','news','testimonial'); |
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
if (!empty($sections_customizer_data)) |
| 434 |
{ |
| 435 |
foreach($sections_customizer_data as $section_customizer_data) |
| 436 |
{ |
| 437 |
require_once('inc/wpblack/customizer/'.$section_customizer_data.'-section.php'); |
| 438 |
} |
| 439 |
} |
| 440 |
$wp_customize->remove_control('header_textcolor'); |
| 441 |
|
| 442 |
} |
| 443 |
add_action( 'customize_register', 'spiceb_wpblack_customize_register' ); |
| 444 |
endif; |
| 445 |
|
| 446 |
$sections_data = array('slider','services','team','news','testimonial'); |
| 447 |
|
| 448 |
if (!empty($sections_data)){ |
| 449 |
|
| 450 |
foreach($sections_data as $section_data){ |
| 451 |
require_once('inc/wpblack/sections/wpblack-'.$section_data.'-section.php'); |
| 452 |
} |
| 453 |
} |
| 454 |
|
| 455 |
require_once('inc/wpblack/customizer.php'); |
| 456 |
|
| 457 |
endif; |
| 458 |
} |
| 459 |
} |
| 460 |
add_action( 'init', 'spiceb_activate' ); |
| 461 |
|
| 462 |
|
| 463 |
$theme = wp_get_theme(); |
| 464 |
if ( 'SpicePress' == $theme->name || 'SpicePress Dark' == $theme->name || 'Rockers' == $theme->name || 'Content' == $theme->name || 'Certify' == $theme->name || 'Stacy' == $theme->name || 'SpicePress Child Theme' == $theme->name || 'Chilly' == $theme->name || 'SpiceBlue' == $theme->name || 'SpicePress Child' == $theme->name){ |
| 465 |
|
| 466 |
|
| 467 |
register_activation_hook( __FILE__, 'spiceb_install_function'); |
| 468 |
function spiceb_install_function() |
| 469 |
{ |
| 470 |
$item_details_page = get_option('item_details_page'); |
| 471 |
if(!$item_details_page){ |
| 472 |
require_once('inc/spicepress/default-pages/upload-media.php'); |
| 473 |
require_once('inc/spicepress/default-pages/about-page.php'); |
| 474 |
require_once('inc/spicepress/default-pages/home-page.php'); |
| 475 |
require_once('inc/spicepress/default-pages/blog-page.php'); |
| 476 |
require_once('inc/spicepress/default-pages/contact-page.php'); |
| 477 |
require_once('inc/spicepress/default-pages/portfolio-page.php'); |
| 478 |
require_once('inc/spicepress/default-widgets/default-widget.php'); |
| 479 |
update_option( 'item_details_page', 'Done' ); |
| 480 |
} |
| 481 |
} |
| 482 |
|
| 483 |
} |
| 484 |
|
| 485 |
|
| 486 |
//Honeypress |
| 487 |
if ( 'HoneyPress' == $theme->name || 'HoneyPress Child' == $theme->name || 'Radix Multipurpose' == $theme->name || 'HoneyWaves' == $theme->name || 'Bizhunt' == $theme->name || 'Tromas' == $theme->name || 'HoneyBee' == $theme->name || 'Honeypress Dark' == $theme->name ){ |
| 488 |
register_activation_hook( __FILE__, 'spiceb_install_function'); |
| 489 |
function spiceb_install_function() |
| 490 |
{ |
| 491 |
$item_details_page = get_option('item_details_page'); |
| 492 |
if(!$item_details_page){ |
| 493 |
require_once('inc/honeypress/default-pages/upload-media.php'); |
| 494 |
require_once('inc/honeypress/default-pages/home-page.php'); |
| 495 |
require_once('inc/honeypress/default-pages/blog-page.php'); |
| 496 |
require_once('inc/honeypress/default-widgets/default-widget.php'); |
| 497 |
update_option( 'item_details_page', 'Done' ); |
| 498 |
} |
| 499 |
} |
| 500 |
} |
| 501 |
|
| 502 |
//CloudPress |
| 503 |
if ( 'CloudPress' == $theme->name || 'CloudPress Child' == $theme->name || 'CloudPress Dark' == $theme->name || 'CloudPress Agency' == $theme->name || 'CloudPress Business' == $theme->name){ |
| 504 |
register_activation_hook( __FILE__, 'spiceb_cloudpress_install_function'); |
| 505 |
function spiceb_cloudpress_install_function() |
| 506 |
{ |
| 507 |
$item_details_page = get_option('item_details_page'); |
| 508 |
if(!$item_details_page){ |
| 509 |
require_once('inc/cloudpress/default-pages/upload-media.php'); |
| 510 |
require_once('inc/cloudpress/default-pages/home-page.php'); |
| 511 |
require_once('inc/cloudpress/default-pages/blog-page.php'); |
| 512 |
require_once('inc/cloudpress/default-widgets/default-widget.php'); |
| 513 |
update_option( 'item_details_page', 'Done' ); |
| 514 |
} |
| 515 |
} |
| 516 |
} |
| 517 |
|
| 518 |
//Innofit |
| 519 |
if ( 'Innofit' == $theme->name || 'Innofit Child' == $theme->name){ |
| 520 |
|
| 521 |
register_activation_hook( __FILE__, 'spiceb_install_function'); |
| 522 |
function spiceb_install_function() |
| 523 |
{ |
| 524 |
$item_details_page = get_option('item_details_page'); |
| 525 |
if(!$item_details_page){ |
| 526 |
require_once('inc/innofit/default-pages/upload-media.php'); |
| 527 |
require_once('inc/innofit/default-pages/home-page.php'); |
| 528 |
require_once('inc/innofit/default-widgets/default-widget.php'); |
| 529 |
require_once('inc/innofit/default-pages/home-custom-menu.php'); |
| 530 |
update_option( 'item_details_page', 'Done' ); |
| 531 |
} |
| 532 |
} |
| 533 |
|
| 534 |
} |
| 535 |
|
| 536 |
//Metabox Seeting For Chilly Theme |
| 537 |
if ( 'Chilly' == $theme->name ) |
| 538 |
{ |
| 539 |
require_once('inc/chilly/post-meta.php'); |
| 540 |
} |
| 541 |
|
| 542 |
//BusiCare |
| 543 |
if ( 'BusiCare' == $theme->name || 'BusiCare Child' == $theme->name || 'BusiCare Dark' == $theme->name){ |
| 544 |
register_activation_hook( __FILE__, 'spiceb_busicare_install_function'); |
| 545 |
function spiceb_busicare_install_function(){ |
| 546 |
$item_details_page = get_option('item_details_page'); |
| 547 |
if(!$item_details_page){ |
| 548 |
require_once('inc/busicare/default-pages/upload-media.php'); |
| 549 |
require_once('inc/busicare/default-pages/home-page.php'); |
| 550 |
require_once('inc/busicare/default-pages/blog-page.php'); |
| 551 |
require_once('inc/busicare/default-widgets/default-widget.php'); |
| 552 |
update_option( 'item_details_page', 'Done' ); |
| 553 |
} |
| 554 |
} |
| 555 |
} |
| 556 |
|
| 557 |
// Spice Software |
| 558 |
if ( 'Spice Software' == $theme->name || 'Spice Software Dark' == $theme->name || 'Spice Software Child' == $theme->name){ |
| 559 |
register_activation_hook( __FILE__, 'spiceb_spice_software_install_function'); |
| 560 |
function spiceb_spice_software_install_function(){ |
| 561 |
$item_details_page = get_option('item_details_page'); |
| 562 |
if(!$item_details_page){ |
| 563 |
require_once('inc/spice-software/default-pages/upload-media.php'); |
| 564 |
require_once('inc/spice-software/default-pages/home-page.php'); |
| 565 |
require_once('inc/spice-software/default-pages/blog-page.php'); |
| 566 |
require_once('inc/spice-software/default-widgets/default-widget.php'); |
| 567 |
update_option( 'item_details_page', 'Done' ); |
| 568 |
} |
| 569 |
} |
| 570 |
} |
| 571 |
|
| 572 |
// Spiko |
| 573 |
if ( 'Spiko' == $theme->name || 'Spiko Child' == $theme->name || 'Spiko Dark' == $theme->name){ |
| 574 |
register_activation_hook( __FILE__, 'spiceb_spiko_install_function'); |
| 575 |
function spiceb_spiko_install_function(){ |
| 576 |
$item_details_page = get_option('item_details_page'); |
| 577 |
if(!$item_details_page){ |
| 578 |
require_once('inc/spiko/default-pages/upload-media.php'); |
| 579 |
require_once('inc/spiko/default-pages/home-page.php'); |
| 580 |
require_once('inc/spiko/default-pages/blog-page.php'); |
| 581 |
update_option( 'item_details_page', 'Done' ); |
| 582 |
} |
| 583 |
} |
| 584 |
} |
| 585 |
|
| 586 |
// WPKites |
| 587 |
if ( 'WPKites' == $theme->name || 'WPKites Child' == $theme->name || 'WPKites Dark' == $theme->name){ |
| 588 |
register_activation_hook( __FILE__, 'spiceb_wpkites_install_function'); |
| 589 |
function spiceb_wpkites_install_function(){ |
| 590 |
$item_details_page = get_option('item_details_page'); |
| 591 |
if(!$item_details_page){ |
| 592 |
require_once('inc/wpkites/default-pages/upload-media.php'); |
| 593 |
require_once('inc/wpkites/default-pages/home-page.php'); |
| 594 |
require_once('inc/wpkites/default-pages/blog-page.php'); |
| 595 |
update_option( 'item_details_page', 'Done' ); |
| 596 |
} |
| 597 |
} |
| 598 |
} |
| 599 |
|
| 600 |
// WPHester |
| 601 |
if ( 'WPHester' == $theme->name || 'WPHester Child' == $theme->name || 'WPHester Dark' == $theme->name){ |
| 602 |
register_activation_hook( __FILE__, 'spiceb_kites_install_function'); |
| 603 |
function spiceb_kites_install_function(){ |
| 604 |
$item_details_page = get_option('item_details_page'); |
| 605 |
if(!$item_details_page){ |
| 606 |
require_once('inc/wphester/default-pages/upload-media.php'); |
| 607 |
require_once('inc/wphester/default-pages/home-page.php'); |
| 608 |
require_once('inc/wphester/default-pages/blog-page.php'); |
| 609 |
update_option( 'item_details_page', 'Done' ); |
| 610 |
} |
| 611 |
} |
| 612 |
} |
| 613 |
// WPBlack |
| 614 |
if ( 'WPBlack' == $theme->name || 'WPBlack Child' == $theme->name || 'WPBlack Dark' == $theme->name){ |
| 615 |
register_activation_hook( __FILE__, 'spiceb_wpblack_install_function'); |
| 616 |
function spiceb_wpblack_install_function(){ |
| 617 |
$item_details_page = get_option('item_details_page'); |
| 618 |
if(!$item_details_page){ |
| 619 |
require_once('inc/wpblack/default-pages/upload-media.php'); |
| 620 |
require_once('inc/wpblack/default-pages/home-page.php'); |
| 621 |
require_once('inc/wpblack/default-pages/blog-page.php'); |
| 622 |
update_option( 'item_details_page', 'Done' ); |
| 623 |
} |
| 624 |
} |
| 625 |
} |
| 626 |
//Sanatize for spicepress |
| 627 |
//radio box sanitization function |
| 628 |
function spiceb_sanitize_radio( $input, $setting ){ |
| 629 |
//input must be a slug: lowercase alphanumeric characters, dashes and underscores are allowed only |
| 630 |
$input = sanitize_key($input); |
| 631 |
//get the list of possible radio box options |
| 632 |
$choices = $setting->manager->get_control( $setting->id )->choices; |
| 633 |
//return input if valid or return default option |
| 634 |
return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); |
| 635 |
} |
| 636 |
//Select sanitization callback |
| 637 |
function spiceb_select_text_sanitization( $input, $setting ){ |
| 638 |
|
| 639 |
//input must be a slug: lowercase alphanumeric characters, dashes and underscores are allowed only |
| 640 |
$input = sanitize_key($input); |
| 641 |
|
| 642 |
//get the list of possible select options |
| 643 |
$choices = $setting->manager->get_control( $setting->id )->choices; |
| 644 |
|
| 645 |
//return input if valid or return default option |
| 646 |
return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); |
| 647 |
|
| 648 |
} |
| 649 |
//Sanatize checkbox |
| 650 |
function spiceb_sanitize_checkbox( $checked ) { |
| 651 |
// Boolean check. |
| 652 |
return ( ( isset( $checked ) && true == $checked ) ? true : false ); |
| 653 |
} |
| 654 |
//Sanatize text |
| 655 |
function spiceb_spicepress_home_page_sanitize_text( $input ) { |
| 656 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 657 |
} |
| 658 |
|
| 659 |
//Sanatize for honeypress theme |
| 660 |
function spiceb_honeypress_home_page_sanitize_text( $input ) { |
| 661 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 662 |
} |
| 663 |
//Sanatize for CloudPress theme |
| 664 |
function spiceb_cloudpress_home_page_sanitize_text( $input ) { |
| 665 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 666 |
} |
| 667 |
//Sanatize for Busicare theme |
| 668 |
function spiceb_busicare_home_page_sanitize_text($input){ |
| 669 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 670 |
} |
| 671 |
function spiceb_busicare_sanitize_checkbox($checked) { |
| 672 |
// Boolean check. |
| 673 |
return ( ( isset($checked) && true == $checked ) ? true : false ); |
| 674 |
} |
| 675 |
//Sanatize for Spice Software theme |
| 676 |
function spiceb_spice_software_home_page_sanitize_text($input){ |
| 677 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 678 |
} |
| 679 |
function spiceb_spice_software_sanitize_checkbox($checked) { |
| 680 |
// Boolean check. |
| 681 |
return ( ( isset($checked) && true == $checked ) ? true : false ); |
| 682 |
} |
| 683 |
//Sanatize for Spiko theme |
| 684 |
function spiceb_spiko_home_page_sanitize_text($input){ |
| 685 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 686 |
} |
| 687 |
function spiceb_spiko_sanitize_checkbox($checked) { |
| 688 |
// Boolean check. |
| 689 |
return ( ( isset($checked) && true == $checked ) ? true : false ); |
| 690 |
} |
| 691 |
//Sanatize for wpkites theme |
| 692 |
function spiceb_wpkites_home_page_sanitize_text($input){ |
| 693 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 694 |
} |
| 695 |
function spiceb_wpkites_sanitize_checkbox($checked) { |
| 696 |
// Boolean check. |
| 697 |
return ( ( isset($checked) && true == $checked ) ? true : false ); |
| 698 |
} |
| 699 |
//Sanatize for hester theme |
| 700 |
function spiceb_wphester_home_page_sanitize_text($input){ |
| 701 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 702 |
} |
| 703 |
function spiceb_wphester_sanitize_checkbox($checked) { |
| 704 |
// Boolean check. |
| 705 |
return ( ( isset($checked) && true == $checked ) ? true : false ); |
| 706 |
} |
| 707 |
//Sanatize for wpblack theme |
| 708 |
function spiceb_wpblack_home_page_sanitize_text($input){ |
| 709 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 710 |
} |
| 711 |
function spiceb_wpblack_sanitize_checkbox($checked) { |
| 712 |
// Boolean check. |
| 713 |
return ( ( isset($checked) && true == $checked ) ? true : false ); |
| 714 |
} |
| 715 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 716 |
if ( ! is_plugin_active( 'innofit-plus/innofit-plus.php' ) ): |
| 717 |
function spiceb_innofit_home_page_sanitize_text( $input ) { |
| 718 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 719 |
} |
| 720 |
endif; |
| 721 |
if ('SpicePress' == $theme->name || 'SpicePress Dark' == $theme->name || 'Rockers' == $theme->name || 'Content' == $theme->name || 'Certify' == $theme->name || 'Stacy' == $theme->name || 'SpicePress Child Theme' == $theme->name || 'SpicePress Child' == $theme->name || 'Chilly' == $theme->name) |
| 722 |
{ |
| 723 |
add_action( 'switch_theme', 'spicepresstheme_deactivate_message' ); |
| 724 |
function spicepresstheme_deactivate_message() |
| 725 |
{ |
| 726 |
$theme = wp_get_theme(); |
| 727 |
if($theme->template!='spicepress'){ |
| 728 |
require_once('inc/feedback-pop-up-form.php'); |
| 729 |
} |
| 730 |
} |
| 731 |
} |
| 732 |
if ( 'Innofit' == $theme->name || 'Innofit Child' == $theme->name) |
| 733 |
{ |
| 734 |
add_action( 'switch_theme', 'innofittheme_deactivate_message' ); |
| 735 |
function innofittheme_deactivate_message() |
| 736 |
{ |
| 737 |
$theme = wp_get_theme(); |
| 738 |
if($theme->template!='innofit'){ |
| 739 |
require_once('inc/innofit-feedback-pop-up-form.php'); |
| 740 |
} |
| 741 |
} |
| 742 |
} |
| 743 |
add_action( 'init', 'spiceb_load_textdomain' ); |
| 744 |
/** |
| 745 |
* Load plugin textdomain. |
| 746 |
*/ |
| 747 |
function spiceb_load_textdomain() { |
| 748 |
load_plugin_textdomain( 'spicebox', false, plugin_dir_url(__FILE__). 'languages' ); |
| 749 |
} |