Black Studio TinyMCE Widget - Version 1.4.5

Version Description

  • Fixed compatibility issue with Page Builder + WPML String Translation
Download this release

Release Info

Developer marcochiesi
Plugin Icon 128x128 Black Studio TinyMCE Widget
Version 1.4.5
Comparing to
See all releases

Code changes from version 1.4.4 to 1.4.5

Files changed (2) hide show
  1. black-studio-tinymce-widget.php +16 -7
  2. readme.txt +4 -1
black-studio-tinymce-widget.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Black Studio TinyMCE Widget
4
Plugin URI: http://wordpress.org/extend/plugins/black-studio-tinymce-widget/
5
Description: Adds a WYSIWYG widget based on the standard TinyMCE WordPress visual editor.
6
- Version: 1.4.4
7
Author: Black Studio
8
Author URI: http://www.blackstudio.it
9
License: GPLv3
@@ -31,9 +31,9 @@ class WP_Widget_Black_Studio_TinyMCE extends WP_Widget {
31
$after_text = apply_filters( 'black_studio_tinymce_after_text', '</div>', $instance );
32
$title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base );
33
$text = apply_filters( 'widget_text', $instance['text'], $instance );
34
- if ( function_exists( 'icl_t' ) ) {
35
$title = icl_t( "Widgets", 'widget title - ' . md5 ( $title ), $title );
36
- $text = icl_t( "Widgets", 'widget body - ' . $this->id_base . '-' . $this->number, $text );
37
}
38
$text = do_shortcode( $text );
39
echo $before_widget;
@@ -47,14 +47,14 @@ class WP_Widget_Black_Studio_TinyMCE extends WP_Widget {
47
function update( $new_instance, $old_instance ) {
48
$instance = $old_instance;
49
$instance['title'] = strip_tags( $new_instance['title'] );
50
- if ( current_user_can('unfiltered_html') ) {
51
$instance['text'] = $new_instance['text'];
52
}
53
else {
54
- $instance['text'] = stripslashes( wp_filter_post_kses( addslashes($new_instance['text']) ) ); // wp_filter_post_kses() expects slashed
55
}
56
$instance['type'] = strip_tags( $new_instance['type'] );
57
- if ( function_exists( 'icl_register_string' )) {
58
//icl_register_string( "Widgets", 'widget title - ' . $this->id_base . '-' . $this->number /* md5 ( apply_filters( 'widget_title', $instance['title'] ))*/, apply_filters( 'widget_title', $instance['title'] ) ); // This is handled automatically by WPML
59
icl_register_string( "Widgets", 'widget body - ' . $this->id_base . '-' . $this->number, apply_filters( 'widget_text', $instance['text'] ) );
60
}
@@ -271,7 +271,7 @@ function black_studio_tinymce_apply_smilies_to_widget_text( $text ) {
271
return $text;
272
}
273
274
- /* Hack needed to enable full media options when adding content form media library */
275
/* (this is done excluding post_id parameter in Thickbox iframe url) */
276
add_filter( '_upload_iframe_src', 'black_studio_tinymce_upload_iframe_src' );
277
function black_studio_tinymce_upload_iframe_src ( $upload_iframe_src ) {
@@ -291,3 +291,12 @@ function black_studio_tinymce_editor_accessibility_mode($editor) {
291
}
292
return $editor;
293
}
3
Plugin Name: Black Studio TinyMCE Widget
4
Plugin URI: http://wordpress.org/extend/plugins/black-studio-tinymce-widget/
5
Description: Adds a WYSIWYG widget based on the standard TinyMCE WordPress visual editor.
6
+ Version: 1.4.5
7
Author: Black Studio
8
Author URI: http://www.blackstudio.it
9
License: GPLv3
31
$after_text = apply_filters( 'black_studio_tinymce_after_text', '</div>', $instance );
32
$title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base );
33
$text = apply_filters( 'widget_text', $instance['text'], $instance );
34
+ if ( function_exists( 'icl_t' ) && ! empty( $this->number ) ) {
35
$title = icl_t( "Widgets", 'widget title - ' . md5 ( $title ), $title );
36
+ $text = var_export($instance, true) . icl_t( "Widgets", 'widget body - ' . $this->id_base . '-' . $this->number, $text );
37
}
38
$text = do_shortcode( $text );
39
echo $before_widget;
47
function update( $new_instance, $old_instance ) {
48
$instance = $old_instance;
49
$instance['title'] = strip_tags( $new_instance['title'] );
50
+ if ( current_user_can( 'unfiltered_html' ) ) {
51
$instance['text'] = $new_instance['text'];
52
}
53
else {
54
+ $instance['text'] = stripslashes( wp_filter_post_kses( addslashes( $new_instance['text'] ) ) ); // wp_filter_post_kses() expects slashed
55
}
56
$instance['type'] = strip_tags( $new_instance['type'] );
57
+ if ( function_exists( 'icl_register_string' ) && ! empty( $this->number ) ) {
58
//icl_register_string( "Widgets", 'widget title - ' . $this->id_base . '-' . $this->number /* md5 ( apply_filters( 'widget_title', $instance['title'] ))*/, apply_filters( 'widget_title', $instance['title'] ) ); // This is handled automatically by WPML
59
icl_register_string( "Widgets", 'widget body - ' . $this->id_base . '-' . $this->number, apply_filters( 'widget_text', $instance['text'] ) );
60
}
271
return $text;
272
}
273
274
+ /* Hack needed to enable full media options when adding content from media library */
275
/* (this is done excluding post_id parameter in Thickbox iframe url) */
276
add_filter( '_upload_iframe_src', 'black_studio_tinymce_upload_iframe_src' );
277
function black_studio_tinymce_upload_iframe_src ( $upload_iframe_src ) {
291
}
292
return $editor;
293
}
294
+
295
+ /* Hack for compatibility with Page Builder + WPML String Translation */
296
+ add_filter( 'siteorigin_panels_widget_object', 'black_studio_tinymce_siteorigin_panels_widget_object', 10, 2 );
297
+ function black_studio_tinymce_siteorigin_panels_widget_object( $the_widget, $widget ) {
298
+ if ( $the_widget->id_base == 'black-studio-tinymce' ) {
299
+ $the_widget->number = '';
300
+ }
301
+ return $the_widget;
302
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.blackstudio.it/en/wordpress-plugins/black-studio-tinymce
4
Tags: wysiwyg, widget, tinymce, editor, image, media, rich text, rich text editor, visual editor, wysiwyg editor, tinymce editor, widget editor, html editor, wysiwyg widget, html widget, editor widget, text widget, rich text widget, enhanced text widget, tinymce widget, visual widget, image widget, media widget
5
Requires at least: 3.0
6
Tested up to: 4.0
7
- Stable tag: 1.4.4
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl.html
10
@@ -111,6 +111,9 @@ add_filter( 'black_studio_tinymce_after_text', '__return_empty_string' );
111
112
== Changelog ==
113
114
= 1.4.4 =
115
* Fixed z-index compatibility issue with Shortcodes Ultimate plugin
116
4
Tags: wysiwyg, widget, tinymce, editor, image, media, rich text, rich text editor, visual editor, wysiwyg editor, tinymce editor, widget editor, html editor, wysiwyg widget, html widget, editor widget, text widget, rich text widget, enhanced text widget, tinymce widget, visual widget, image widget, media widget
5
Requires at least: 3.0
6
Tested up to: 4.0
7
+ Stable tag: 1.4.5
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl.html
10
111
112
== Changelog ==
113
114
+ = 1.4.5 =
115
+ * Fixed compatibility issue with Page Builder + WPML String Translation
116
+
117
= 1.4.4 =
118
* Fixed z-index compatibility issue with Shortcodes Ultimate plugin
119