Spice Box - Version 0.6

Version Description

  1. Update version.
Download this release

Release Info

Developer spicethemes
Plugin Icon wp plugin Spice Box
Version 0.6
Comparing to
See all releases

Code changes from version 0.5 to 0.6

Files changed (3) hide show
  1. inc/chilly/post-meta.php +98 -0
  2. readme.txt +5 -1
  3. spicebox.php +6 -1
inc/chilly/post-meta.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('admin_init','chilly_metabox_init');
3
+ function chilly_metabox_init()
4
+ {
5
+ add_meta_box('chilly_metabox_page', __('Enable slider Banner on the page','spicebox'), 'chilly_meta_banner', 'page', 'normal', 'high');
6
+ add_meta_box('chilly_metabox_page', __('Enable slider Banner on the page','spicebox'), 'chilly_postmeta_banner', 'post', 'normal', 'high');
7
+ add_action('save_post','chilly_meta_data_save');
8
+ add_action('save_post','chilly_meta_postdata_save');
9
+ }
10
+
11
+
12
+ function chilly_meta_banner()
13
+ {
14
+ global $post ;
15
+ $chilly_banner_chkbx = sanitize_text_field( get_post_meta( get_the_ID(), 'chilly_banner_chkbx', true ));
16
+ if(metadata_exists( 'post', get_the_ID(), 'chilly_banner_chkbx'))
17
+ {
18
+ ?>
19
+ <input type="checkbox" name="chilly_banner_chkbx" id="chilly_banner_chkbx" <?php if($chilly_banner_chkbx){echo "checked='checked'";}?> />
20
+ <?php
21
+ }
22
+ else
23
+ {
24
+ ?>
25
+ <input checked type="checkbox" name="chilly_banner_chkbx" id="chilly_banner_chkbx" />
26
+ <?php
27
+ }
28
+ ?>
29
+
30
+ <?php _e('Click Here To Activate Slider on Individually This Page','spicebox'); ?>
31
+ <?php
32
+ }
33
+
34
+ function chilly_postmeta_banner()
35
+ {
36
+ global $post ;
37
+ $chilly_postbanner_chkbx = sanitize_text_field( get_post_meta( get_the_ID(), 'chilly_postbanner_chkbx', true ));
38
+ if(metadata_exists( 'post', get_the_ID(), 'chilly_postbanner_chkbx'))
39
+ {
40
+ ?>
41
+ <input type="checkbox" name="chilly_postbanner_chkbx" id="chilly_postbanner_chkbx" <?php if($chilly_postbanner_chkbx){echo "checked='checked'";}?> />
42
+ <?php
43
+ }
44
+ else
45
+ {
46
+ ?>
47
+ <input checked type="checkbox" name="chilly_postbanner_chkbx" id="chilly_postbanner_chkbx" />
48
+ <?php
49
+ }
50
+ ?>
51
+
52
+ <?php _e('Click Here To Activate Slider on Individually This Post','spicebox'); ?>
53
+ <?php
54
+ }
55
+
56
+
57
+ function chilly_meta_data_save($post_id)
58
+ {
59
+ if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || (defined('DOING_AJAX') && DOING_AJAX) || isset($_REQUEST['bulk_edit']))
60
+ return;
61
+
62
+ if ( ! current_user_can( 'edit_page', $post_id ) )
63
+ { return ; }
64
+
65
+ if(isset( $_POST['post_ID']))
66
+ {
67
+ $post_ID = $_POST['post_ID'];
68
+ $post_type=get_post_type($post_ID);
69
+
70
+ if($post_type=='page')
71
+ {
72
+ update_post_meta($post_ID, 'chilly_banner_chkbx', sanitize_text_field(isset($_POST['chilly_banner_chkbx'])));
73
+
74
+ }
75
+
76
+ }
77
+ }
78
+ function chilly_meta_postdata_save($post_id)
79
+ {
80
+ if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || (defined('DOING_AJAX') && DOING_AJAX) || isset($_REQUEST['bulk_edit']))
81
+ return;
82
+
83
+ if ( ! current_user_can( 'edit_page', $post_id ) )
84
+ { return ; }
85
+
86
+ if(isset( $_POST['post_ID']))
87
+ {
88
+ $post_ID = $_POST['post_ID'];
89
+ $post_type=get_post_type($post_ID);
90
+
91
+ if($post_type=='post')
92
+ {
93
+ update_post_meta($post_ID, 'chilly_postbanner_chkbx', sanitize_text_field(isset($_POST['chilly_postbanner_chkbx'])));
94
+
95
+ }
96
+
97
+ }
98
+ }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: spicethemes
3
  Tags: widget, admin, widgets
4
  Requires at least: 3.3+
5
  Tested up to: 5.0.3
6
- Stable tag: 0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -115,4 +115,8 @@ This plugin create repeater controls in the customizer settings allowing you to
115
 
116
  = 0.4 =
117
 
 
 
 
 
118
  1. Update version.
3
  Tags: widget, admin, widgets
4
  Requires at least: 3.3+
5
  Tested up to: 5.0.3
6
+ Stable tag: 0.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
115
 
116
  = 0.4 =
117
 
118
+ = 0.5 =
119
+ 1. Add Meta Box Feature of slider setting for chilly theme
120
+
121
+ = 0.6 =
122
  1. Update version.
spicebox.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: SpiceBox
4
  Plugin URI:
5
  Description: Enhances SpiceThemes with extra functionality.
6
- Version: 0.5
7
  Author: Spicethemes
8
  Author URI: https://github.com
9
  Text Domain: spicebox
@@ -133,6 +133,11 @@ $item_details_page = get_option('item_details_page');
133
 
134
  }
135
 
 
 
 
 
 
136
 
137
  //Sanatize text
138
  function spiceb_spicepress_home_page_sanitize_text( $input ) {
3
  Plugin Name: SpiceBox
4
  Plugin URI:
5
  Description: Enhances SpiceThemes with extra functionality.
6
+ Version: 0.6
7
  Author: Spicethemes
8
  Author URI: https://github.com
9
  Text Domain: spicebox
133
 
134
  }
135
 
136
+ //Metabox Seeting For Chilly Theme
137
+ if ( 'Chilly' == $theme->name )
138
+ {
139
+ require_once('inc/chilly/post-meta.php');
140
+ }
141
 
142
  //Sanatize text
143
  function spiceb_spicepress_home_page_sanitize_text( $input ) {