| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: SpiceBox |
| 4 |
Plugin URI: |
| 5 |
Description: Enhances SpiceThemes with extra functionality. |
| 6 |
Version: 0.3.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 |
require_once('inc/innofit/features/feature-slider-section.php'); |
| 41 |
require_once('inc/innofit/features/feature-service-section.php'); |
| 42 |
require_once('inc/innofit/features/feature-about-section.php'); |
| 43 |
require_once('inc/innofit/features/feature-testimonial-section.php'); |
| 44 |
require_once('inc/innofit/features/feature-team-section.php'); |
| 45 |
require_once('inc/innofit/features/feature-callout-section.php'); |
| 46 |
require_once('inc/innofit/features/feature-contact-section.php'); |
| 47 |
require_once('inc/innofit/features/feature-subscribe-section.php'); |
| 48 |
require_once('inc/innofit/features/feature-wooshop-section.php'); |
| 49 |
require_once('inc/innofit/sections/innofit-slider-section.php'); |
| 50 |
require_once('inc/innofit/sections/innofit-service-section.php'); |
| 51 |
require_once('inc/innofit/sections/innofit-about-section.php'); |
| 52 |
require_once('inc/innofit/sections/innofit-testimonail-section.php'); |
| 53 |
require_once('inc/innofit/sections/innofit-team-section.php'); |
| 54 |
require_once('inc/innofit/sections/innofit-callout-section.php'); |
| 55 |
require_once('inc/innofit/sections/innofit-contact-section.php'); |
| 56 |
require_once('inc/innofit/sections/innofit-subscriber-section.php'); |
| 57 |
require_once('inc/innofit/sections/innofit-wooproduct-section.php'); |
| 58 |
|
| 59 |
require_once('inc/innofit/customizer.php'); |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
} |
| 64 |
add_action( 'init', 'spiceb_activate' ); |
| 65 |
|
| 66 |
|
| 67 |
$theme = wp_get_theme(); |
| 68 |
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){ |
| 69 |
|
| 70 |
|
| 71 |
register_activation_hook( __FILE__, 'spiceb_install_function'); |
| 72 |
function spiceb_install_function() |
| 73 |
{ |
| 74 |
$item_details_page = get_option('item_details_page'); |
| 75 |
if(!$item_details_page){ |
| 76 |
require_once('inc/spicepress/default-pages/upload-media.php'); |
| 77 |
require_once('inc/spicepress/default-pages/about-page.php'); |
| 78 |
require_once('inc/spicepress/default-pages/home-page.php'); |
| 79 |
require_once('inc/spicepress/default-pages/blog-page.php'); |
| 80 |
require_once('inc/spicepress/default-pages/contact-page.php'); |
| 81 |
require_once('inc/spicepress/default-pages/portfolio-page.php'); |
| 82 |
require_once('inc/spicepress/default-widgets/default-widget.php'); |
| 83 |
update_option( 'item_details_page', 'Done' ); |
| 84 |
} |
| 85 |
} |
| 86 |
|
| 87 |
} |
| 88 |
|
| 89 |
|
| 90 |
//Innofit |
| 91 |
if ( 'Innofit' == $theme->name ){ |
| 92 |
|
| 93 |
register_activation_hook( __FILE__, 'spiceb_install_function'); |
| 94 |
function spiceb_install_function() |
| 95 |
{ |
| 96 |
$item_details_page = get_option('item_details_page'); |
| 97 |
if(!$item_details_page){ |
| 98 |
require_once('inc/innofit/default-pages/upload-media.php'); |
| 99 |
require_once('inc/innofit/default-pages/home-page.php'); |
| 100 |
require_once('inc/innofit/default-widgets/default-widget.php'); |
| 101 |
require_once('inc/innofit/default-pages/home-custom-menu.php'); |
| 102 |
update_option( 'item_details_page', 'Done' ); |
| 103 |
} |
| 104 |
} |
| 105 |
|
| 106 |
} |
| 107 |
|
| 108 |
|
| 109 |
//Sanatize text |
| 110 |
function spiceb_spicepress_home_page_sanitize_text( $input ) { |
| 111 |
|
| 112 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 113 |
|
| 114 |
} |
| 115 |
|
| 116 |
function spiceb_innofit_home_page_sanitize_text( $input ) { |
| 117 |
|
| 118 |
return wp_kses_post( force_balance_tags( $input ) ); |
| 119 |
|
| 120 |
} |
| 121 |
?> |