PluginProbe
SpiceBox / trunk
SpiceBox vtrunk
trunk 0.2.2 0.2.3 0.2.4 0.2.5 0.2.6 0.2.7 0.2.8 0.2.9 0.3 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 0.3.8 0.3.9.1 0.3.9.2 0.4 0.5 0.6 0.7 1.0 All 76 releases
spicebox / spicebox.php

spicebox.php in SpiceBox trunk, at spicebox.php

70 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: SpiceBox
4 Plugin URI:
5 Description: Enhances Spicethemes with extra functionality.
6 Version: 0.2.2
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 ){
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 }
30 add_action( 'init', 'spiceb_activate' );
31
32
33 $theme = wp_get_theme();
34 if ( 'SpicePress' == $theme->name ){
35
36
37 register_activation_hook( __FILE__, 'spiceb_install_function');
38 function spiceb_install_function()
39 {
40 $item_details_page = get_option('item_details_page');
41 if(!$item_details_page){
42 //post status and options
43 $post = array(
44 'comment_status' => 'closed',
45 'ping_status' => 'closed' ,
46 'post_author' => 1,
47 'post_date' => date('Y-m-d H:i:s'),
48 'post_name' => 'Home',
49 'post_status' => 'publish' ,
50 'post_title' => 'Home',
51 'post_type' => 'page',
52 );
53 //insert page and save the id
54 $newvalue = wp_insert_post( $post, false );
55 if ( $newvalue && ! is_wp_error( $newvalue ) ){
56 update_post_meta( $newvalue, '_wp_page_template', 'template-business.php' );
57
58 // Use a static front page
59 $page = get_page_by_title('Home');
60 update_option( 'show_on_front', 'page' );
61 update_option( 'page_on_front', $page->ID );
62
63 }
64 //save the id in the database
65 update_option( 'item_details_page', $newvalue );
66 }
67 }
68
69 }
70 ?>