Widget Content Blocks - Version 2.2.5

Version Description

  • October 26, 2013 =
  • Added checkbox option to widget to hide the title.
Download this release

Release Info

Developer DvanKooten
Plugin Icon wp plugin Widget Content Blocks
Version 2.2.5
Comparing to
See all releases

Code changes from version 2.2.4 to 2.2.5

includes/WYSIWYG_Widgets_Widget.php CHANGED
@@ -23,11 +23,12 @@ class WYSIWYG_Widgets_Widget extends WP_Widget
23
  $id = $instance['wysiwyg-widget-id'];
24
 
25
  $title = apply_filters( 'widget_title', $instance['title'] );
 
26
  $post = get_post($id);
27
 
28
  echo $before_widget;
29
 
30
- if(!empty($title)) { echo $before_title . $title . $after_title; }
31
 
32
  if($post && !empty($id)) {
33
  $content = $post->post_content;
@@ -63,6 +64,7 @@ class WYSIWYG_Widgets_Widget extends WP_Widget
63
  $instance = array();
64
  $instance['wysiwyg-widget-id'] = $new_instance['wysiwyg-widget-id'];
65
  $instance['title'] = strip_tags($new_instance['title']);
 
66
 
67
  // grab title from widget block
68
  if($instance['wysiwyg-widget-id']) {
@@ -91,10 +93,11 @@ class WYSIWYG_Widgets_Widget extends WP_Widget
91
  ));
92
 
93
  $title = isset($instance['title']) ? $instance['title'] : '';
 
94
  $selected_widget_id = (isset($instance['wysiwyg-widget-id'])) ? $instance['wysiwyg-widget-id'] : 0;
95
  ?>
96
 
97
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="hidden" value="<?php echo esc_attr( $title ); ?>" />
98
 
99
  <p>
100
  <label for="<?php echo $this->get_field_id( 'wysiwyg-widget-id' ); ?>"><?php _e( 'Widget Block to show:' ); ?></label>
@@ -106,6 +109,10 @@ class WYSIWYG_Widgets_Widget extends WP_Widget
106
  </select>
107
  </p>
108
 
 
 
 
 
109
  <p class="help">Manage your widget blocks <a href="edit.php?post_type=wysiwyg-widget">here</a></p>
110
  <?php
111
  }
23
  $id = $instance['wysiwyg-widget-id'];
24
 
25
  $title = apply_filters( 'widget_title', $instance['title'] );
26
+ $show_title = (isset($instance['show_title']) && $instance['show_title']) ? 1 : 0;
27
  $post = get_post($id);
28
 
29
  echo $before_widget;
30
 
31
+ if($show_title) { echo $before_title . $title . $after_title; }
32
 
33
  if($post && !empty($id)) {
34
  $content = $post->post_content;
64
  $instance = array();
65
  $instance['wysiwyg-widget-id'] = $new_instance['wysiwyg-widget-id'];
66
  $instance['title'] = strip_tags($new_instance['title']);
67
+ $instance['show_title'] = (isset($new_instance['show_title']) && $new_instance['show_title'] == 1) ? 1 : 0;
68
 
69
  // grab title from widget block
70
  if($instance['wysiwyg-widget-id']) {
93
  ));
94
 
95
  $title = isset($instance['title']) ? $instance['title'] : '';
96
+ $show_title = (isset($instance['show_title']) && $instance['show_title']) ? 1 : 0;
97
  $selected_widget_id = (isset($instance['wysiwyg-widget-id'])) ? $instance['wysiwyg-widget-id'] : 0;
98
  ?>
99
 
100
+ <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="hidden" value="<?php echo esc_attr( $title ); ?>" />
101
 
102
  <p>
103
  <label for="<?php echo $this->get_field_id( 'wysiwyg-widget-id' ); ?>"><?php _e( 'Widget Block to show:' ); ?></label>
109
  </select>
110
  </p>
111
 
112
+ <p>
113
+ <label><input type="checkbox" id="<?php echo $this->get_field_id('show_title'); ?>" name="<?php echo $this->get_field_name('show_title'); ?>" value="1" <?php checked($show_title, 1); ?> /> <?php _e("Show title?", "wysiwyg-widgets"); ?></label>
114
+ </p>
115
+
116
  <p class="help">Manage your widget blocks <a href="edit.php?post_type=wysiwyg-widget">here</a></p>
117
  <?php
118
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://dannyvankooten.com/donate/
4
  Tags: visual,tinymce,fckeditor,widget,widgets,rich text,wysiwyg,image widget,visual editor,html
5
  Requires at least: 3.1
6
  Tested up to: 3.7
7
- Stable tag: 2.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -67,6 +67,9 @@ Yes, totally. Donations are appreciated though!
67
 
68
  == Changelog ==
69
 
 
 
 
70
  = 2.2.4 - October 21, 2013 =
71
  * Moved menu item back to its own menu item
72
  * Widget title now defaults to the title of the selected Widget Block
4
  Tags: visual,tinymce,fckeditor,widget,widgets,rich text,wysiwyg,image widget,visual editor,html
5
  Requires at least: 3.1
6
  Tested up to: 3.7
7
+ Stable tag: 2.2.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
67
 
68
  == Changelog ==
69
 
70
+ = 2.2.5 - October 26, 2013 =
71
+ * Added checkbox option to widget to hide the title.
72
+
73
  = 2.2.4 - October 21, 2013 =
74
  * Moved menu item back to its own menu item
75
  * Widget title now defaults to the title of the selected Widget Block
wysiwyg-widgets.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WYSIWYG Widgets
4
  Plugin URI: http://DannyvanKooten.com/wordpress-plugins/wysiwyg-widgets/
5
  Description: Adds a WYSIWYG Widget with a rich text editor and media upload functions.
6
- Version: 2.2.4
7
  Author: Danny van Kooten
8
  Author URI: http://DannyvanKooten.com
9
  License: GPL2
@@ -25,7 +25,7 @@ License: GPL2
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
28
- define("WYWI_VERSION_NUMBER", "2.2.4");
29
  define("WYWI_PLUGIN_DIR", plugin_dir_path(__FILE__));
30
 
31
  require_once WYWI_PLUGIN_DIR . 'includes/WYSIWYG_Widgets.php';
3
  Plugin Name: WYSIWYG Widgets
4
  Plugin URI: http://DannyvanKooten.com/wordpress-plugins/wysiwyg-widgets/
5
  Description: Adds a WYSIWYG Widget with a rich text editor and media upload functions.
6
+ Version: 2.2.5
7
  Author: Danny van Kooten
8
  Author URI: http://DannyvanKooten.com
9
  License: GPL2
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
28
+ define("WYWI_VERSION_NUMBER", "2.2.5");
29
  define("WYWI_PLUGIN_DIR", plugin_dir_path(__FILE__));
30
 
31
  require_once WYWI_PLUGIN_DIR . 'includes/WYSIWYG_Widgets.php';