SMK Sidebar Generator - Version 3.4.1

Version Description

  • Bug fix: "All single" -- incorrect conditional
Download this release

Release Info

Developer _smartik_
Plugin Icon 128x128 SMK Sidebar Generator
Version 3.4.1
Comparing to
See all releases

Code changes from version 3.4.0 to 3.4.1

Files changed (5) hide show
  1. apply.php +1 -1
  2. condition-cpt.php +1 -1
  3. readme.md +4 -88
  4. readme.txt +13 -9
  5. smk-sidebar-generator.php +2 -2
apply.php CHANGED
@@ -33,7 +33,7 @@ if( ! class_exists('Smk_Sidebar_Generator_Apply')) {
33
  $newclass = new $class;
34
  $second_condition = ( !empty($condition['equalto']) ) ? $condition['equalto'] : array();
35
  $can_replace = $newclass->canReplace( $the_type[1], $second_condition );
36
- if( $can_replace ){
37
  foreach ($sidebars_to_replace as $sidebar_to_replace_id) {
38
  if( array_key_exists($sidebar_to_replace_id, $sidebars) && isset($sidebars[ $sidebar_id ]) ){
39
  $sidebars[ $sidebar_to_replace_id ] = $sidebars[ $sidebar_id ];
33
  $newclass = new $class;
34
  $second_condition = ( !empty($condition['equalto']) ) ? $condition['equalto'] : array();
35
  $can_replace = $newclass->canReplace( $the_type[1], $second_condition );
36
+ if( (bool) $can_replace ){
37
  foreach ($sidebars_to_replace as $sidebar_to_replace_id) {
38
  if( array_key_exists($sidebar_to_replace_id, $sidebars) && isset($sidebars[ $sidebar_id ]) ){
39
  $sidebars[ $sidebar_to_replace_id ] = $sidebars[ $sidebar_id ];
condition-cpt.php CHANGED
@@ -113,7 +113,7 @@ class Smk_Sidebar_Generator_Condition_Cpt extends Smk_Sidebar_Generator_Conditio
113
  ){
114
  $can = true;
115
  }
116
- elseif( in_array('all_single', (array) $second_selection) && is_single( $first_selection ) ){
117
  $can = true;
118
  }
119
  elseif( in_array(get_the_ID(), (array)$second_selection)){
113
  ){
114
  $can = true;
115
  }
116
+ elseif( in_array('all_single', (array) $second_selection) && is_singular( $first_selection ) ){
117
  $can = true;
118
  }
119
  elseif( in_array(get_the_ID(), (array)$second_selection)){
readme.md CHANGED
@@ -1,93 +1,9 @@
1
- This plugin generates as many sidebars as you need. Then allows you to place them on any page you wish.
2
-
3
- #### Version 3.0 is here!
4
- The new version 3.x has many advantages compared with the old 2.x. First and the most important is that it remove the need to add some special code to the theme in order to display the generated sidebar. That's because it now can override the default sidebar and apply special conditions for any page on your site.
5
-
6
 
7
- <!--**Demo video:** http://youtu.be/fluNdMnSCKA-->
8
-
9
- <!--iframe width="560" height="315" src="//www.youtube.com/embed/fluNdMnSCKA" frameborder="0" allowfullscreen></iframe-->
10
-
11
- * Author : Andrew Surdu - https://zerowp.com/
12
- * License : GPLv2
13
- * Development branch: https://github.com/awps/Wordpress-Sidebar-Generator
14
- * Issue tracker: https://github.com/awps/Wordpress-Sidebar-Generator/issues
15
 
16
  ####Features:
17
  * Unlimited number of sidebars.
18
- * Replace default theme sidebars using the conditions or globaly just by selecting the sidebar that you want to replace.
19
  * Show the generated sidebars on any page you wish without touching a single line of code in your theme.
20
- * Drag to sort sidebar position.
21
-
22
- ####How to install this plugin?
23
- Like any other Wordpress plugin. <br />
24
- Drop `smk-sidebar-generator` to `wp-content/plugins/`.<br />
25
- More info here: http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
26
-
27
- ####Backward compatibility.
28
-
29
- Because you probably still need them, these functions are still here to not break your site.
30
- **Note:** The following code is for vesion 2.x In the latest version of this plugin they are not required. Do not use them anymore!!!
31
-
32
- **Display a sidebar using `smk_sidebar` function:**
33
- <pre>
34
- if(function_exists('smk_sidebar'){
35
- smk_sidebar('sidebarID');
36
- }
37
- </pre>
38
- **Display a sidebar using wp native function:**
39
- <pre>
40
- if(function_exists('dynamic_sidebar') && dynamic_sidebar('sidebarID')) :
41
- endif;
42
- </pre>
43
-
44
- **Display a sidebar using built-in shortcode:**
45
- <pre>
46
- [smk_sidebar id="sidebarID"]
47
- </pre>
48
-
49
- == Installation ==
50
-
51
- 1. Upload the `smk-sidebar-generator` folder to the `/wp-content/plugins/` directory
52
- 2. Activate the SMK Sidebar Generator plugin through the 'Plugins' menu in WordPress
53
- 3. Configure the plugin by going to the SMK Sidebars menu that appears in your admin menu
54
-
55
- == Changelog ==
56
-
57
- = 3.1 =
58
- * Added localization support(if you want to translate it in your language, create a pull requests on Github).
59
- * Added shortcode with ID to each sidebar.
60
-
61
- = 3.0 =
62
- * **Complete rewrite from scratch.** The plugin now allows to create an unlimited number of sidebars without the need to touch a single line of code in your theme.
63
- * Now you can use conditions to apply the sidebar on any page, post ar CPT you wish. _Soon will be added support for taxonomies, 404 page and other(please suggest)_.
64
- * The widgets now use the theme style and tags. That means the newly generated sidebars will look good on any theme, no need for additional styling.
65
- * Modular code. You can create and register your own conditions. That's mainly not required but can be handy for some developers.
66
-
67
- = 2.3.2 =
68
- * Quick fix UI. When a new sidebar is created, it display an incorect info and it was fixed only after page refresh.
69
- * Removed unused files, since version 3.0 is on development `smk_sidebar_metabox.php` was removed, as it was never used and is not required for the next versions.
70
-
71
- = 2.3.1 =
72
- * Quick fix for shortcode smk_sidebar ID. Shortcode did not work because the ID was not set correctly.
73
- * Added new tab "How to use?" and links to docs.
74
-
75
- = 2.3 =
76
- * **Added import/export functions.**
77
- * Changes to `smk_sidebar` shortcode. Previously to get a sidebar required only an integer number, now you can get any sidebar using the shortcode just giving the id, even if the sidebar is not generated using Sidebar Generator plugin.
78
- * Added plugin version to enqueued scripts and style.
79
-
80
- = 2.2 =
81
- * Confirm sidebar remove.
82
- * Bug fix: Sidebars could not be added when all previous sidebars were removed.
83
- * Bug fix: Fixed ajax name validation.
84
-
85
- = 2.1.1 =
86
- * enqueue styles and scripts only on plugin page, not on all WP dashboard pages.
87
- * `admin_enqueue_scripts` make use of `SMK_SBG_URI` constant.
88
-
89
- = 2.1 =
90
- * `smk_get_all_sidebars()` function is included in plugin. Anyways, you must include it in your theme `functions.php`, because if you'll deactivate the plugin it will return a fatal error.
91
-
92
- = 2.0 =
93
- * Initial release
1
+ ![](https://ps.w.org/smk-sidebar-generator/assets/banner-772x250.png)
 
 
 
 
2
 
3
+ This plugin generates as many sidebars as you need. Then allows you to place them on any page you wish.
 
 
 
 
 
 
 
4
 
5
  ####Features:
6
  * Unlimited number of sidebars.
7
+ * Replace default theme sidebars using the conditions or globally just by selecting the sidebar that you want to replace.
8
  * Show the generated sidebars on any page you wish without touching a single line of code in your theme.
9
+ * Drag to sort the sidebar position.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: _smartik_
3
  Tags: sidebar, widget, generator, custom, unlimited
4
  Requires at least: 4.0
5
  Tested up to: 5.5
6
- Stable tag: 3.4.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -28,23 +28,22 @@ Like any other Wordpress plugin. <br />
28
  Drop `smk-sidebar-generator` to `wp-content/plugins/`.<br />
29
  More info here: http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
30
 
31
- ####Backward compatibility.
 
32
 
33
- Because you probably still need them, these functions are still here to not break your site.
34
- **Note:** The following code is for version 2.x In the latest version of this plugin they are not required. Do not use them anymore!!!
35
-
36
- **Display a sidebar using `smk_sidebar` function:**
37
  <pre>
38
  if(function_exists('smk_sidebar'){
39
  smk_sidebar('sidebarID');
40
  }
41
  </pre>
42
- **Display a sidebar using wp native function:**
 
43
  <pre>
44
  dynamic_sidebar('sidebarID'));
45
  </pre>
46
 
47
- **Display a sidebar using built-in shortcode:**
48
  <pre>
49
  [smk_sidebar id="sidebarID"]
50
  </pre>
@@ -57,12 +56,17 @@ dynamic_sidebar('sidebarID'));
57
 
58
  == Screenshots ==
59
  1. Admin panel
 
 
60
 
61
 
62
  == Changelog ==
63
 
 
 
 
64
  = 3.4.0 =
65
- * Fix" Incorrect conditional replacement.
66
  * Compatibility with WordPress 5.5
67
 
68
  = 3.1 =
3
  Tags: sidebar, widget, generator, custom, unlimited
4
  Requires at least: 4.0
5
  Tested up to: 5.5
6
+ Stable tag: 3.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
28
  Drop `smk-sidebar-generator` to `wp-content/plugins/`.<br />
29
  More info here: http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
30
 
31
+ ####Developer helpers.
32
+ **You actually don't need any of these. The plugin can be managed fully from WP Admin without writing a single line of code.**
33
 
34
+ Display a sidebar using `smk_sidebar` function:
 
 
 
35
  <pre>
36
  if(function_exists('smk_sidebar'){
37
  smk_sidebar('sidebarID');
38
  }
39
  </pre>
40
+
41
+ Display a sidebar using wp native function:
42
  <pre>
43
  dynamic_sidebar('sidebarID'));
44
  </pre>
45
 
46
+ Display a sidebar using built-in shortcode:
47
  <pre>
48
  [smk_sidebar id="sidebarID"]
49
  </pre>
56
 
57
  == Screenshots ==
58
  1. Admin panel
59
+ 2. Conditions
60
+ 3. Removal && time-limited option to restore.
61
 
62
 
63
  == Changelog ==
64
 
65
+ = 3.4.1 =
66
+ * Bug fix: "All single" -- incorrect conditional
67
+
68
  = 3.4.0 =
69
+ * Fix: Incorrect conditional replacement.
70
  * Compatibility with WordPress 5.5
71
 
72
  = 3.1 =
smk-sidebar-generator.php CHANGED
@@ -3,8 +3,8 @@
3
  * Plugin Name: SMK Sidebar Generator
4
  * Plugin URI: https://zerowp.com/sidebar-generator
5
  * Description: Generate an unlimited number of sidebars and assign them to any page using the conditional options without touching a single line of code.
6
- * Author: Andrei Surdu
7
- * Version: 3.4.0
8
  * Author URI: https://zerowp.com
9
  * Licence: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
3
  * Plugin Name: SMK Sidebar Generator
4
  * Plugin URI: https://zerowp.com/sidebar-generator
5
  * Description: Generate an unlimited number of sidebars and assign them to any page using the conditional options without touching a single line of code.
6
+ * Author: Andrew Surdu
7
+ * Version: 3.4.1
8
  * Author URI: https://zerowp.com
9
  * Licence: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html