| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: SpiceBox |
| 4 |
Plugin URI: |
| 5 |
Description: Enhances SpiceThemes with extra functionality. |
| 6 |
Version: 0.4 |
| 7 |
Author: Spicethemes |
| 8 |
Author URI: https://github.com |
| 9 |
Text Domain: spicebox |
| 10 |
*/ |
| 11 |
define( 'SPICEB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 12 |
define( 'SPICEB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 13 |
|
| 14 |
function spiceb_activate() { |
| 15 |
$theme = wp_get_theme(); // gets the current theme |
| 16 |
if ( 'SpicePress' == $theme->name || 'Rockers' == $theme->name || 'Content' == $theme->name || 'Certify' == $theme->name || 'Stacy' == $theme->name || 'SpicePress Child Theme' == $theme->name){ |
| 17 |
require_once('inc/spicepress/features/feature-slider-section.php'); |
| 18 |
require_once('inc/spicepress/features/feature-service-section.php'); |
| 19 |
require_once('inc/spicepress/features/feature-portfolio-section.php'); |
| 20 |
require_once('inc/spicepress/features/feature-testimonial-section.php'); |
| 21 |
require_once('inc/spicepress/sections/spicepress-slider-section.php'); |
| 22 |
require_once('inc/spicepress/sections/spicepress-features-section.php'); |
| 23 |
require_once('inc/spicepress/sections/spicepress-portfolio-section.php'); |
| 24 |
require_once('inc/spicepress/sections/spicepress-testimonail-section.php'); |
| 25 |
require_once('inc/spicepress/customizer.php'); |
| 26 |
|
| 27 |
} |
| 28 |
|
| 29 |
if ( 'Chilly' == $theme->name || 'SpiceBlue' == $theme->name){ |
| 30 |
require_once('inc/spicepress/features/feature-service-section.php'); |
| 31 |
require_once('inc/spicepress/features/feature-portfolio-section.php'); |
| 32 |
require_once('inc/spicepress/features/feature-testimonial-section.php'); |
| 33 |
require_once('inc/spicepress/sections/spicepress-features-section.php'); |
| 34 |
require_once('inc/spicepress/sections/spicepress-portfolio-section.php'); |
| 35 |
require_once('inc/spicepress/sections/spicepress-testimonail-section.php'); |
| 36 |
require_once('inc/spicepress/customizer.php'); |
| 37 |
} |
| 38 |
|
| 39 |
if ( 'Innofit' == $theme->name){ |
| 40 |
|
| 41 |
|
| 42 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 43 |
|
| 44 |
|
| 45 |
if ( ! is_plugin_active( 'innofit-plus/innofit-plus.php' ) ): |
| 46 |
|
| 47 |
|
| 48 |
if ( ! function_exists( 'spiceb_innofit_customize_register' ) ) : |
| 49 |
function spiceb_innofit_customize_register($wp_customize){ |
| 50 |
|
| 51 |
$sections_customizer_data = array('slider','services','about','testimonial','team','news','callout','contact','subscriber','wooproduct','portfolio','instagram','map','pricing','funfact','client'); |
| 52 |
|
| 53 |
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh'; |
| 54 |
|
| 55 |
if (!empty($sections_customizer_data)) |
| 56 |
{ |
| 57 |
foreach($sections_customizer_data as $section_customizer_data) |
| 58 |
{ |
| 59 |
require_once('inc/innofit/customizer/'.$section_customizer_data.'-section.php'); |
| 60 |
} |
| 61 |
} |
| 62 |
require_once('inc/innofit/customizer/customizer_theme_style.php'); |
| 63 |
require_once('inc/innofit/customizer/customizer_typography.php'); |
| 64 |
require_once('inc/innofit/customizer/customizer_layout_manager.php'); |
| 65 |
require_once('inc/innofit/customizer/customizer_color_back_settings.php'); |
| 66 |
|
| 67 |
} |
| 68 |
add_action( 'customize_register', 'spiceb_innofit_customize_register' ); |
| 69 |
endif; |
| 70 |
|
| 71 |
|
| 72 |
$sections_data = array('slider','services','about','testimonial','team','news','callout','contact','subscriber','wooproduct'); |
| 73 |
|
| 74 |
if (!empty($sections_data)) |
| 75 |
{ |
| 76 |
foreach($sections_data as $section_data) |
| 77 |
{ |
| 78 |
require_once('inc/innofit/sections/innofit-'.$section_data.'-section.php'); |
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
require_once('inc/innofit/customizer/customizer-render-callbacks.php'); |
| 83 |
require_once('inc/innofit/customizer.php'); |
| 84 |
|
| 85 |
|
| 86 |
endif; |
| 87 |
|
| 88 |
} |
| 89 |
|
| 90 |
|
| 91 |
} |
| 92 |
add_action( 'init', 'spiceb_activate' ); |
| 93 |
|
| 94 |
|
| 95 |
$theme = wp_get_theme(); |
| 96 |
if ( 'SpicePress' == $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){ |
| 97 |
|
| 98 |
|
| 99 |
register_activation_hook( __FILE__, 'spiceb_install_function'); |
| 100 |
function spiceb_install_function() |
| 101 |
{ |
| 102 |
$item_details_page = get_option('item_details_page'); |
| 103 |
if(!$item_details_page){ |
| 104 |
require_once('inc/spicepress/default-pages/upload-media.php'); |
| 105 |
require_once('inc/spicepress/default-pages/about-page.php'); |
| 106 |
require_once('inc/spicepress/default-pages/home-page.php'); |
| 107 |
require_once('inc/spicepress/default-pages/blog-page.php'); |
| 108 |
require_once('inc/spicepress/default-pages/contact-page.php'); |
| 109 |
require_once('inc/spicepress/default-pages/portfolio-page.php'); |
| 110 |
require_once('inc/spicepress/default-widgets/default-widget.php'); |
| 111 |
update_option( 'item_details_page', 'Done' ); |
| 112 |
} |
| 113 |
} |
| 114 |
|
| 115 |
} |
| 116 |
|
| 117 |
|
| 118 |
//Innofit |
| 119 |
if ( 'Innofit' == $theme->name ){ |
| 120 |
|
| 121 |
register_activation_hook( __FILE__, 'spiceb_install_function'); |
| 122 |
function spiceb_install_function() |
| 123 |
{ |
| 124 |
$item_details_page = get_option('item_details_page'); |
| 125 |
if(!$item_details_page){ |
| 126 |
require_once('inc/innofit/default-pages/upload-media.php'); |
| 127 |
require_once('inc/innofit/default-pages/home-page.php'); |
| 128 |
require_once('inc/innofit/default-widgets/default-widget.php'); |
| 129 |
require_once('inc/innofit/default-pages/home-custom-menu.php'); |
| 130 |
update_option( 'item_details_page', 'Done' ); |
| 131 |
} |
| 132 |
} |
| 133 |
|
| 134 |
} |
| 135 |
|
| 136 |
|
| 137 |
//Sanatize text |
| 138 |
function spiceb_spicepress_home_page_sanitize_text( $input ) { |
| 139 |
|
| 140 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 141 |
|
| 142 |
} |
| 143 |
|
| 144 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 145 |
|
| 146 |
|
| 147 |
if ( ! is_plugin_active( 'innofit-plus/innofit-plus.php' ) ): |
| 148 |
|
| 149 |
function spiceb_innofit_home_page_sanitize_text( $input ) { |
| 150 |
|
| 151 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 152 |
|
| 153 |
} |
| 154 |
|
| 155 |
endif; |
| 156 |
?> |