Black Studio TinyMCE Widget - Version 1.4.3

Version Description

  • Added filter hooks to modify the markup before and after the widget text
  • Fixed z-index issue in fullscreen mode
  • Added widget icon for theme customizer
  • Updated danish translation
  • Updated FAQ and readme.txt
Download this release

Release Info

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

Code changes from version 1.4.2 to 1.4.3

black-studio-tinymce-widget.css CHANGED
@@ -1,4 +1,7 @@
1
  /* CSS Document */
2
  #wp-black-studio-tinymce-widget-wrap {
3
  display: none;
 
 
 
4
  }
1
  /* CSS Document */
2
  #wp-black-studio-tinymce-widget-wrap {
3
  display: none;
4
+ }
5
+ #available-widgets [class*="black-studio-tinymce"] .widget-title:before {
6
+ content: "\f116";
7
  }
black-studio-tinymce-widget.js CHANGED
@@ -106,7 +106,7 @@ var wpActiveEditor;
106
  });
107
  });
108
  $( '#wpbody-content' ).css( 'overflow', 'visible' ); // needed for small screens
109
- $widget.css( 'position', 'relative' ).css( 'z-index', '10000' ); // needed for small screens
110
  black_studio_open_deferred_activate_visual_editor( $text_area.attr( 'id' ) );
111
  $( '.insert-media', $widget ).data( 'editor', $text_area.attr( 'id' ) );
112
  });
106
  });
107
  });
108
  $( '#wpbody-content' ).css( 'overflow', 'visible' ); // needed for small screens
109
+ $widget.css( 'position', 'relative' ).css( 'z-index', '100010' ); // needed for small screens and for fullscreen mode
110
  black_studio_open_deferred_activate_visual_editor( $text_area.attr( 'id' ) );
111
  $( '.insert-media', $widget ).data( 'editor', $text_area.attr( 'id' ) );
112
  });
black-studio-tinymce-widget.min.js CHANGED
@@ -1 +1 @@
1
- var tinyMCEPreInit;var wpActiveEditor;(function(c){function d(g){c("#"+g).addClass("mceEditor");if(typeof tinyMCE=="object"&&typeof tinyMCE.execCommand=="function"){b(g);tinyMCEPreInit.mceInit[g]=tinyMCEPreInit.mceInit["black-studio-tinymce-widget"];tinyMCEPreInit.mceInit[g]["selector"]="#"+g;try{tinymce.init(tinymce.extend({},tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[g]));tinyMCE.execCommand("mceAddControl",false,g)}catch(f){alert(f)}if(tinyMCE.get(g)!=null){if(typeof tinyMCE.get(g).on=="function"){tinyMCE.get(g).on("keyup change",function(){var h=tinyMCE.get(g).getContent();c("textarea#"+g).val(h).change()})}}}}function b(g){if(typeof tinyMCE=="object"&&typeof tinyMCE.execCommand=="function"){if(tinyMCE.get(g)!=null&&typeof tinyMCE.get(g).getContent=="function"){var f=tinyMCE.get(g).getContent();tinyMCE.get(g).remove();c("textarea#"+g).val(f)}}}function a(f){c("div.widget-inside:has(#"+f+") input[id^=widget-black-studio-tinymce][id$=type][value=visual]").each(function(){if(c("div.widget:has(#"+f+") :animated").size()==0&&tinyMCE.get(f)==null&&c("#"+f).is(":visible")){c("a[id^=widget-black-studio-tinymce][id$=tmce]",c(this).closest("div.widget-inside")).click()}else{if(tinyMCE.get(f)==null){setTimeout(function(){a(f);f=null},100)}else{c("a[id^=widget-black-studio-tinymce][id$=tmce]",c(this).closest("div.widget-inside")).click()}}})}function e(f){c("div.widget-inside:has(#"+f+") input[id^=widget-black-studio-tinymce][id$=type][value=visual]").each(function(){if(c.active==0&&tinyMCE.get(f)==null&&c("#"+f).is(":visible")){c("a[id^=widget-black-studio-tinymce][id$=tmce]",c(this).closest("div.widget-inside")).click()}else{if(c("div.widget:has(#"+f+") div.widget-inside").is(":visible")&&tinyMCE.get(f)==null){setTimeout(function(){e(f);f=null},100)}}})}c(document).ready(function(){c(document).on("click","div.widget:has(textarea[id^=widget-black-studio-tinymce]) .widget-title, div.widget:has(textarea[id^=widget-black-studio-tinymce]) a.widget-action",function(g){var j=c(this).closest("div.widget");var i=c("textarea[id^=widget-black-studio-tinymce]",j);if(c('[name="'+c("#"+i.attr("id")).attr("name")+'"]').size()>1){var h=c("div.widget-inside",j);if(c("div.error",h).length==0){h.prepend('<div class="error"><strong>'+black_studio_tinymce_local.error_duplicate_id+"</strong></div>")}}c("input[name=savewidget]",j).on("click",function(k){var m=c(this).closest("div.widget");var l=c("textarea[id^=widget-black-studio-tinymce]",m);if(tinyMCE.get(l.attr("id"))!=null){b(l.attr("id"))}c(this).unbind("ajaxSuccess").ajaxSuccess(function(o,p,n){var q=c("textarea[id^=widget-black-studio-tinymce]",c(this).closest("div.widget-inside"));e(q.attr("id"))})});c("#wpbody-content").css("overflow","visible");j.css("position","relative").css("z-index","10000");a(i.attr("id"));c(".insert-media",j).data("editor",i.attr("id"))});c("div.widget[id*=black-studio-tinymce] input[name=savewidget]").on("click",function(g){var i=c(this).closest("div.widget");var h=c("textarea[id^=widget-black-studio-tinymce]",i);if(tinyMCE.get(h.attr("id"))!=null){b(h.attr("id"))}c(this).unbind("ajaxSuccess").ajaxSuccess(function(k,l,j){var m=c("textarea[id^=widget-black-studio-tinymce]",c(this).closest("div.widget-inside"));e(m.attr("id"))})});c(document).on("click","a[id^=widget-black-studio-tinymce][id$=tmce]",function(h){var i=c(this).closest("div.widget-inside,div.panel-dialog");var j=c("div[id^=wp-widget-black-studio-tinymce][id$=-wrap]",i);var g=c("textarea[id^=widget-black-studio-tinymce]",i).attr("id");tinymce.DOM.removeClass(j,"html-active");tinymce.DOM.addClass(j,"tmce-active");c("input[id^=widget-black-studio-tinymce][id$=type]",i).val("visual");d(g)});c(document).on("click","a[id^=widget-black-studio-tinymce][id$=html]",function(h){var i=c(this).closest("div.widget-inside,div.panel-dialog");var j=c("div[id^=wp-widget-black-studio-tinymce][id$=-wrap]",i);var g=c("textarea[id^=widget-black-studio-tinymce]",i).attr("id");c("input[id^=widget-black-studio-tinymce][id$=type]",i).val("visual");tinymce.DOM.removeClass(j,"tmce-active");tinymce.DOM.addClass(j,"html-active");c("input[id^=widget-black-studio-tinymce][id$=type]",i).val("html");b(g)});c(document).on("click",".wp-media-buttons a",function(){var g=c(this).closest("div.widget-inside");wpActiveEditor=c("textarea[id^=widget-black-studio-tinymce]",g).attr("id")});if(c("body.widgets_access").size()>0){var f=c("textarea[id^=widget-black-studio-tinymce]");a(f.attr("id"))}})})(jQuery);
1
+ var tinyMCEPreInit;var wpActiveEditor;(function(c){function d(g){c("#"+g).addClass("mceEditor");if(typeof tinyMCE=="object"&&typeof tinyMCE.execCommand=="function"){b(g);tinyMCEPreInit.mceInit[g]=tinyMCEPreInit.mceInit["black-studio-tinymce-widget"];tinyMCEPreInit.mceInit[g]["selector"]="#"+g;try{tinymce.init(tinymce.extend({},tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[g]));tinyMCE.execCommand("mceAddControl",false,g)}catch(f){alert(f)}if(tinyMCE.get(g)!=null){if(typeof tinyMCE.get(g).on=="function"){tinyMCE.get(g).on("keyup change",function(){var h=tinyMCE.get(g).getContent();c("textarea#"+g).val(h).change()})}}}}function b(g){if(typeof tinyMCE=="object"&&typeof tinyMCE.execCommand=="function"){if(tinyMCE.get(g)!=null&&typeof tinyMCE.get(g).getContent=="function"){var f=tinyMCE.get(g).getContent();tinyMCE.get(g).remove();c("textarea#"+g).val(f)}}}function a(f){c("div.widget-inside:has(#"+f+") input[id^=widget-black-studio-tinymce][id$=type][value=visual]").each(function(){if(c("div.widget:has(#"+f+") :animated").size()==0&&tinyMCE.get(f)==null&&c("#"+f).is(":visible")){c("a[id^=widget-black-studio-tinymce][id$=tmce]",c(this).closest("div.widget-inside")).click()}else{if(tinyMCE.get(f)==null){setTimeout(function(){a(f);f=null},100)}else{c("a[id^=widget-black-studio-tinymce][id$=tmce]",c(this).closest("div.widget-inside")).click()}}})}function e(f){c("div.widget-inside:has(#"+f+") input[id^=widget-black-studio-tinymce][id$=type][value=visual]").each(function(){if(c.active==0&&tinyMCE.get(f)==null&&c("#"+f).is(":visible")){c("a[id^=widget-black-studio-tinymce][id$=tmce]",c(this).closest("div.widget-inside")).click()}else{if(c("div.widget:has(#"+f+") div.widget-inside").is(":visible")&&tinyMCE.get(f)==null){setTimeout(function(){e(f);f=null},100)}}})}c(document).ready(function(){c(document).on("click","div.widget:has(textarea[id^=widget-black-studio-tinymce]) .widget-title, div.widget:has(textarea[id^=widget-black-studio-tinymce]) a.widget-action",function(g){var j=c(this).closest("div.widget");var i=c("textarea[id^=widget-black-studio-tinymce]",j);if(c('[name="'+c("#"+i.attr("id")).attr("name")+'"]').size()>1){var h=c("div.widget-inside",j);if(c("div.error",h).length==0){h.prepend('<div class="error"><strong>'+black_studio_tinymce_local.error_duplicate_id+"</strong></div>")}}c("input[name=savewidget]",j).on("click",function(k){var m=c(this).closest("div.widget");var l=c("textarea[id^=widget-black-studio-tinymce]",m);if(tinyMCE.get(l.attr("id"))!=null){b(l.attr("id"))}c(this).unbind("ajaxSuccess").ajaxSuccess(function(o,p,n){var q=c("textarea[id^=widget-black-studio-tinymce]",c(this).closest("div.widget-inside"));e(q.attr("id"))})});c("#wpbody-content").css("overflow","visible");j.css("position","relative").css("z-index","100010");a(i.attr("id"));c(".insert-media",j).data("editor",i.attr("id"))});c("div.widget[id*=black-studio-tinymce] input[name=savewidget]").on("click",function(g){var i=c(this).closest("div.widget");var h=c("textarea[id^=widget-black-studio-tinymce]",i);if(tinyMCE.get(h.attr("id"))!=null){b(h.attr("id"))}c(this).unbind("ajaxSuccess").ajaxSuccess(function(k,l,j){var m=c("textarea[id^=widget-black-studio-tinymce]",c(this).closest("div.widget-inside"));e(m.attr("id"))})});c(document).on("click","a[id^=widget-black-studio-tinymce][id$=tmce]",function(h){var i=c(this).closest("div.widget-inside,div.panel-dialog");var j=c("div[id^=wp-widget-black-studio-tinymce][id$=-wrap]",i);var g=c("textarea[id^=widget-black-studio-tinymce]",i).attr("id");tinymce.DOM.removeClass(j,"html-active");tinymce.DOM.addClass(j,"tmce-active");c("input[id^=widget-black-studio-tinymce][id$=type]",i).val("visual");d(g)});c(document).on("click","a[id^=widget-black-studio-tinymce][id$=html]",function(h){var i=c(this).closest("div.widget-inside,div.panel-dialog");var j=c("div[id^=wp-widget-black-studio-tinymce][id$=-wrap]",i);var g=c("textarea[id^=widget-black-studio-tinymce]",i).attr("id");c("input[id^=widget-black-studio-tinymce][id$=type]",i).val("visual");tinymce.DOM.removeClass(j,"tmce-active");tinymce.DOM.addClass(j,"html-active");c("input[id^=widget-black-studio-tinymce][id$=type]",i).val("html");b(g)});c(document).on("click",".wp-media-buttons a",function(){var g=c(this).closest("div.widget-inside");wpActiveEditor=c("textarea[id^=widget-black-studio-tinymce]",g).attr("id")});if(c("body.widgets_access").size()>0){var f=c("textarea[id^=widget-black-studio-tinymce]");a(f.attr("id"))}})})(jQuery);
black-studio-tinymce-widget.php CHANGED
@@ -3,10 +3,10 @@
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.2
7
  Author: Black Studio
8
  Author URI: http://www.blackstudio.it
9
- License: GPL2
10
  Text Domain: black-studio-tinymce-widget
11
  Domain Path: /languages
12
  */
@@ -27,6 +27,8 @@ class WP_Widget_Black_Studio_TinyMCE extends WP_Widget {
27
  add_filter( 'widget_text', array( $wp_embed, 'autoembed' ), 8 );
28
  }
29
  extract( $args );
 
 
30
  $title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base );
31
  $text = apply_filters( 'widget_text', $instance['text'], $instance );
32
  if ( function_exists( 'icl_t' ) ) {
@@ -38,9 +40,7 @@ class WP_Widget_Black_Studio_TinyMCE extends WP_Widget {
38
  if ( ! empty( $title ) ) {
39
  echo $before_title . $title . $after_title;
40
  }
41
- ?>
42
- <div class="textwidget"><?php echo $text; ?></div>
43
- <?php
44
  echo $after_widget;
45
  }
46
 
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.3
7
  Author: Black Studio
8
  Author URI: http://www.blackstudio.it
9
+ License: GPLv3
10
  Text Domain: black-studio-tinymce-widget
11
  Domain Path: /languages
12
  */
27
  add_filter( 'widget_text', array( $wp_embed, 'autoembed' ), 8 );
28
  }
29
  extract( $args );
30
+ $before_text = apply_filters( 'black_studio_tinymce_before_text', '<div class="textwidget">', $instance );
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' ) ) {
40
  if ( ! empty( $title ) ) {
41
  echo $before_title . $title . $after_title;
42
  }
43
+ echo $before_text . $text . $after_text;
 
 
44
  echo $after_widget;
45
  }
46
 
languages/black-studio-tinymce-widget-da_DK.po ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Black Studio TinyMCE Widget\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-03-06 12:08+0100\n"
6
+ "PO-Revision-Date: 2014-07-08 22:01+0100\n"
7
+ "Last-Translator: Mikkel Rommelhoff <mr@rommel.dk>\n"
8
+ "Language-Team: Rommel <mr@rommel.dk>\n"
9
+ "Language: da_DK\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Poedit 1.6.6\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+
20
+ #: black-studio-tinymce-widget.php:21
21
+ msgid "Arbitrary text or HTML with visual editor"
22
+ msgstr "Widget med teksteditor eller HTML"
23
+
24
+ #: black-studio-tinymce-widget.php:23
25
+ msgid "Visual Editor"
26
+ msgstr "Teksteditor"
27
+
28
+ #: black-studio-tinymce-widget.php:99
29
+ msgid "Donate"
30
+ msgstr "Doner"
31
+
32
+ #: black-studio-tinymce-widget.php:99
33
+ msgid "Support"
34
+ msgstr "Support"
35
+
36
+ #: black-studio-tinymce-widget.php:99
37
+ msgid "Follow"
38
+ msgstr "Følg"
readme.txt CHANGED
@@ -3,17 +3,20 @@ Contributors: marcochiesi, thedarkmist
3
  Donate link: http://www.blackstudio.it/en/wordpress-plugins/black-studio-tinymce-widget/
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: 3.9.1
7
- Stable tag: 1.4.2
 
 
8
 
9
  Adds a WYSIWYG widget based on the standard TinyMCE WordPress visual editor.
10
 
11
  == Description ==
 
12
  This plugin adds a WYSIWYG text widget based on the standard TinyMCE WordPress visual editor. This is intended to overcome the limitations of the default WordPress text widget, so that you can visually add rich text contents to your sidebars, with no knowledge of HTML required.
13
 
14
  = Features =
15
 
16
- * Add rich text widgets to your sidebars using visual editor
17
  * Switch between Visual mode and HTML mode
18
  * Insert images/videos from WordPress Media Library
19
  * Insert links to existing WordPress pages/posts
@@ -46,33 +49,75 @@ This section describes how to install and use the plugin.
46
 
47
  == Frequently Asked Questions ==
48
 
49
- = How to translate widgets using WPML =
50
 
51
- The current version of `Black Studio TinyMCE Widget` plugin works together with the `WPML String translation` plugin. To translate a widget created with `Black Studio TinyMCE Widget` plugin you have to create it on the widgets panel and then go to `WPML` -> `String translation` and translate the title and text from there (unfortunately the translation textarea has no wysywyg editor).
52
- Note: If you installed WPML after the creation of the widgets, just re-save them and they will appear on the String translation list.
53
 
54
- = The plugin doesn't work as expected =
 
 
 
55
 
56
- Please post a message in the [Support forum](http://wordpress.org/support/plugin/black-studio-tinymce-widget), providing the following information:
57
 
58
  * Description of the problem and steps to reproduce it
59
- * Error messages if any (in particular in browser's javascript console)
60
- * Browser / OS in use
61
  * WordPress version in use
62
  * WordPress theme in use
63
- * List of other WordPress plugins installed
 
 
 
 
 
 
 
 
 
 
64
 
65
  = How to embed video and other contents =
66
 
67
- WordPress has a nice [autoembed feature](http://codex.wordpress.org/Embeds) that allows you to embed videos and other stuff in an easy way, by just putting the URL in the content area. This is also possible for widgets created with this plugin, but for best results it is recommended to put the URL inside an `[embed]` shortcode. Example: `[embed]http://www.youtube.com/watch?v=XXXXXXXXXXX[/embed]`. Ensure that the URL has not an hyperlink on it.
 
 
 
68
  Alternatively, if you don't want to use `[embed]` shortcode, ensure that the URL is not surrounded by a `<p>` tag, which is added automatically by the WYSIWYG editor (switch to HTML mode to remove enclosing `<p>` tags).
69
 
70
- = Widgets disappeared after migrating or changing the site URL =
71
-
72
- When dealing with a WordPress site URL change it is necessary to face the "serialized fields" issue: data may become corrupted if using a simple search/replace (see the [Codex](http://codex.wordpress.org/Moving_WordPress#When_Your_Domain_Name_or_URLs_Change) for further info). This is not an issue specifically related to our plugin, but it affects all the parts (plugins, themes and WordPress core files too) that use serialized data archiviation. When changing the site URL, the recommended way is to use the [Search and Replace for WordPress Databases Script](https://interconnectit.com/products/search-and-replace-for-wordpress-databases/), as suggested by the Codex.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  == Changelog ==
75
 
 
 
 
 
 
 
 
76
  = 1.4.2 =
77
  * Added support for `wp_enqueue_editor` hook
78
  * Added compatibility with Advanced Image Styles plugin
3
  Donate link: http://www.blackstudio.it/en/wordpress-plugins/black-studio-tinymce-widget/
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.3
8
+ License: GPLv3
9
+ License URI: http://www.gnu.org/licenses/gpl.html
10
 
11
  Adds a WYSIWYG widget based on the standard TinyMCE WordPress visual editor.
12
 
13
  == Description ==
14
+
15
  This plugin adds a WYSIWYG text widget based on the standard TinyMCE WordPress visual editor. This is intended to overcome the limitations of the default WordPress text widget, so that you can visually add rich text contents to your sidebars, with no knowledge of HTML required.
16
 
17
  = Features =
18
 
19
+ * Add rich text widgets to your sidebars and edit them using visual editor
20
  * Switch between Visual mode and HTML mode
21
  * Insert images/videos from WordPress Media Library
22
  * Insert links to existing WordPress pages/posts
49
 
50
  == Frequently Asked Questions ==
51
 
52
+ = Troubleshooting =
53
 
54
+ If you are experiencing issues with the plugin, check our [support forum](http://wordpress.org/support/plugin/black-studio-tinymce-widget), but please read entirely these FAQ before posting a new topic in the forum. Most of the times issues are caused by incompatibility with other plugins or themes, which don't comply with WordPress coding standars and thus may prevent our plugin from working as expected. If you have any issues with the plugin, please do the following:
 
55
 
56
+ 1. Ensure the you have understood the purpose of the plugin. It only adds the ability to use the visual editor (TinyMCE) in widgets as you do in posts and pages, but it doesn't alter the editor behavior or functions. So if you are experiencing issues with the editor even when editing posts or pages, they're definitely not related to our plugin (unless you're using some additional plugins that provides widgets support for pages, i.e. Page Builder).
57
+ 2. Ensure that you are running the latest versions of both WordPress and the plugin.
58
+ 3. Search in our [support forum](http://wordpress.org/support/plugin/black-studio-tinymce-widget) for threads with similar issues.
59
+ 4. Disable all other plugins and switch to a WordPress default theme for a while. If the problem persists, open a topic in the forum (see below for instructions). Otherwise enable the other plugins ony by one and figure out which one is causing the issue, then post to the support forum mentioning it. Please see [Conflict Diagnosis Guide for WordPress plugins](https://rtcamp.com/rtmedia/docs/troubleshooting/conflict-diagnosis-guide-wordpress-plugins/) for further info.
60
 
61
+ When you post a message in the [support forum](http://wordpress.org/support/plugin/black-studio-tinymce-widget) please provide the following information:
62
 
63
  * Description of the problem and steps to reproduce it
64
+ * Error messages if any, in particular in [browser's javascript console](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)
65
+ * Browser and Operating System in use
66
  * WordPress version in use
67
  * WordPress theme in use
68
+ * WordPress plugins causing conflicts if any
69
+ * A link to a screenshot if it can be useful to undesrtand the problem
70
+
71
+ = Widgets disappeared after migrating or changing the site URL =
72
+
73
+ When dealing with a WordPress site URL change it is necessary to face the "serialized fields" issue: data may become corrupted if using a simple search/replace (see the [Codex](http://codex.wordpress.org/Moving_WordPress#When_Your_Domain_Name_or_URLs_Change) for further info). This is not an issue specifically related to our plugin, but it affects all the parts (plugins, themes and WordPress core files too) that use serialized data archiviation. When changing the site URL, the recommended way is to use the [Search and Replace for WordPress Databases Script](https://interconnectit.com/products/search-and-replace-for-wordpress-databases/), as suggested by the Codex.
74
+
75
+ = How to translate widgets using WPML =
76
+
77
+ The current version of `Black Studio TinyMCE Widget` plugin works together with the `WPML String translation` plugin. To translate a widget created with `Black Studio TinyMCE Widget` plugin you have to create it on the widgets panel and then go to `WPML` -> `String translation` and translate the title and text from there (unfortunately the translation textarea has not the visual editor).
78
+ Note: If you installed WPML after the creation of the widgets, just re-save them and they will appear on the String translation list.
79
 
80
  = How to embed video and other contents =
81
 
82
+ WordPress has a nice [autoembed feature](http://codex.wordpress.org/Embeds) that allows you to embed videos and other stuff in an easy way, by just putting the URL in the content area. This is also possible for widgets created with this plugin, but for best results it is recommended to put the URL inside an `[embed]` shortcode.
83
+ Example:
84
+ `[embed]http://www.youtube.com/watch?v=XXXXXXXXXXX[/embed]`
85
+ Ensure that the URL has not an hyperlink on it.
86
  Alternatively, if you don't want to use `[embed]` shortcode, ensure that the URL is not surrounded by a `<p>` tag, which is added automatically by the WYSIWYG editor (switch to HTML mode to remove enclosing `<p>` tags).
87
 
88
+ = How to customize widget HTML markup =
89
+
90
+ Most of the HTML markup around widgets is generated by WordPress and you can control it using the proper arguments (`class`, `before_widget`, `after_widget`, `before_title`, `after_title`) passed to the [`register_sidebar`](http://codex.wordpress.org/Function_Reference/register_sidebar) function (this is usually done by your theme). The only piece of HTML code added by the plugin is there for compatibility with the markup of native WordPress text widgets, and it is the following:
91
+ `<div class="textwidget"> ... widget text ... </div>`
92
+ You may customize it using the `black_studio_tinymce_before_text` and `black_studio_tinymce_after_text` filter hooks. They both take two parameters, the first one is the default text and the second is the widget instance. See examples below.
93
+
94
+ Example 1: Custom markup
95
+ `
96
+ add_filter( 'black_studio_tinymce_before_text', 'my_widget_before_text', 10, 2 );
97
+ function my_widget_before_text( $before_text, $instance ) {
98
+ return '<div class="myclass">';
99
+ }
100
+ add_filter( 'black_studio_tinymce_after_text', 'my_widget_after_text', 10, 2 );
101
+ function my_widget_after_text( $after_text, $instance ) {
102
+ return '';
103
+ }
104
+ `
105
+
106
+ Example 2: Totally remove markup
107
+ `
108
+ add_filter( 'black_studio_tinymce_before_text', '__return_empty_string' );
109
+ add_filter( 'black_studio_tinymce_after_text', '__return_empty_string' );
110
+ `
111
 
112
  == Changelog ==
113
 
114
+ = 1.4.3 =
115
+ * Added filter hooks to modify the markup before and after the widget text
116
+ * Fixed z-index issue in fullscreen mode
117
+ * Added widget icon for theme customizer
118
+ * Updated danish translation
119
+ * Updated FAQ and readme.txt
120
+
121
  = 1.4.2 =
122
  * Added support for `wp_enqueue_editor` hook
123
  * Added compatibility with Advanced Image Styles plugin