WP Editor Widget - Version 0.6.0

Version Description

  • Added support for WPML - Set the language for each Widget and only the ones for the current active language is output. (Thanks to @docryan)
  • Added filter wp_editor_widget_html - Makes it possible to change the full HTML output of the Widget through a plugin or a theme
  • Added action wp_editor_widget_form - Makes it possibel to add custom form elements to the Widghet through a plugin or a theme
  • Added Scrutinizer code quality check for Github and made some changes to get better score
Download this release

Release Info

Developer feedmeastraycat
Plugin Icon wp plugin WP Editor Widget
Version 0.6.0
Comparing to
See all releases

Code changes from version 0.5.5 to 0.6.0

assets/js/admin.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * WP Editor Widget object
3
  */
4
- WPEditorWidget = {
5
 
6
  /**
7
  * @var string
@@ -20,7 +20,6 @@ WPEditorWidget = {
20
 
21
  /**
22
  * Show the editor
23
- * @param string contentId
24
  */
25
  showEditor: function(contentId) {
26
  jQuery('#wp-editor-widget-backdrop').show();
@@ -53,6 +52,8 @@ WPEditorWidget = {
53
  * Set editor content
54
  */
55
  setEditorContent: function(contentId) {
 
 
56
  var editor = tinyMCE.EditorManager.get('wpeditorwidget');
57
  var content = jQuery('#'+ contentId).val();
58
 
@@ -66,13 +67,18 @@ WPEditorWidget = {
66
  * Update widget and close the editor
67
  */
68
  updateWidgetAndCloseEditor: function() {
 
 
 
 
69
  var editor = tinyMCE.EditorManager.get('wpeditorwidget');
70
 
71
- if (typeof editor == "undefined" || editor == null || editor.isHidden()) {
72
- var content = jQuery('#wpeditorwidget').val();
 
73
  }
74
  else {
75
- var content = editor.getContent();
76
  }
77
 
78
  jQuery('#'+ this.currentContentId).val(content);
@@ -80,7 +86,7 @@ WPEditorWidget = {
80
  // customize.php
81
  if (this.currentEditorPage == "wp-customizer") {
82
  var widget_id = jQuery('#'+ this.currentContentId).closest('div.form').find('input.widget-id').val();
83
- var widget_form_control = wp.customize.Widgets.getWidgetFormControlForWidget( widget_id )
84
  widget_form_control.updateWidget();
85
  }
86
 
1
  /**
2
  * WP Editor Widget object
3
  */
4
+ window.WPEditorWidget = {
5
 
6
  /**
7
  * @var string
20
 
21
  /**
22
  * Show the editor
 
23
  */
24
  showEditor: function(contentId) {
25
  jQuery('#wp-editor-widget-backdrop').show();
52
  * Set editor content
53
  */
54
  setEditorContent: function(contentId) {
55
+ /** global: tinyMCE */
56
+
57
  var editor = tinyMCE.EditorManager.get('wpeditorwidget');
58
  var content = jQuery('#'+ contentId).val();
59
 
67
  * Update widget and close the editor
68
  */
69
  updateWidgetAndCloseEditor: function() {
70
+ /** global: tinyMCE */
71
+ /** global: wp */
72
+ /** global: wpWidgets */
73
+
74
  var editor = tinyMCE.EditorManager.get('wpeditorwidget');
75
 
76
+ var content;
77
+ if (typeof editor == "undefined" || editor === null || editor.isHidden()) {
78
+ content = jQuery('#wpeditorwidget').val();
79
  }
80
  else {
81
+ content = editor.getContent();
82
  }
83
 
84
  jQuery('#'+ this.currentContentId).val(content);
86
  // customize.php
87
  if (this.currentEditorPage == "wp-customizer") {
88
  var widget_id = jQuery('#'+ this.currentContentId).closest('div.form').find('input.widget-id').val();
89
+ var widget_form_control = wp.customize.Widgets.getWidgetFormControlForWidget( widget_id );
90
  widget_form_control.updateWidget();
91
  }
92
 
classes/class-widget.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  //avoid direct calls to this file
3
- if ( !defined( 'ABSPATH' ) ) {
4
  header( 'Status: 403 Forbidden' );
5
  header( 'HTTP/1.1 403 Forbidden' );
6
  exit();
@@ -15,6 +15,14 @@ class WP_Editor_Widget extends WP_Widget {
15
  * Register widget with WordPress.
16
  */
17
  public function __construct() {
 
 
 
 
 
 
 
 
18
 
19
  $widget_ops = apply_filters(
20
  'wp_editor_widget_ops',
@@ -23,10 +31,10 @@ class WP_Editor_Widget extends WP_Widget {
23
  'description' => __( 'Arbitrary text, HTML or rich text through the standard WordPress visual editor.', 'wp-editor-widget' ),
24
  )
25
  );
26
-
27
  parent::__construct(
28
  'WP_Editor_Widget',
29
- __( 'Rich text', 'wp-editor-widget' ),
30
  $widget_ops
31
  );
32
 
@@ -42,21 +50,33 @@ class WP_Editor_Widget extends WP_Widget {
42
  */
43
  public function widget( $args, $instance ) {
44
 
45
- extract( $args );
46
-
47
  $title = apply_filters( 'wp_editor_widget_title', $instance['title'] );
48
  $output_title = apply_filters( 'wp_editor_widget_output_title', $instance['output_title'] );
49
  $content = apply_filters( 'wp_editor_widget_content', $instance['content'] );
50
-
51
- echo $before_widget;
52
-
53
- if ( $output_title == "1" && !empty($title) ) {
54
- echo $before_title . $title . $after_title;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
-
57
- echo $content;
58
-
59
- echo $after_widget;
60
 
61
  } // END widget()
62
 
@@ -69,36 +89,48 @@ class WP_Editor_Widget extends WP_Widget {
69
  */
70
  public function form( $instance ) {
71
 
72
- if ( isset($instance['title']) ) {
73
  $title = $instance['title'];
74
  }
75
  else {
76
  $title = __( 'New title', 'wp-editor-widget' );
77
  }
78
 
79
- if ( isset($instance['content']) ) {
80
  $content = $instance['content'];
81
  }
82
  else {
83
- $content = "";
84
  }
85
 
86
- $output_title = ( isset($instance['output_title']) && $instance['output_title'] == "1" ? true : false );
87
  ?>
88
- <input type="hidden" id="<?php echo $this->get_field_id('content'); ?>" name="<?php echo $this->get_field_name( 'content' ); ?>" value="<?php echo esc_attr($content); ?>">
89
  <p>
90
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'wp-editor-widget' ); ?>:</label>
91
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr($title); ?>" />
92
  </p>
93
  <p>
94
- <a href="javascript:WPEditorWidget.showEditor('<?php echo $this->get_field_id( 'content' ); ?>');" class="button"><?php _e( 'Edit content', 'wp-editor-widget' ) ?></a>
95
  </p>
96
  <p>
97
- <label for="<?php echo $this->get_field_id('output_title'); ?>">
98
- <input type="checkbox" id="<?php echo $this->get_field_id('output_title'); ?>" name="<?php echo $this->get_field_name('output_title'); ?>" value="1" <?php checked($output_title, true) ?>> <?php _e( 'Output title', 'wp-editor-widget' ); ?>
99
  </label>
100
  </p>
 
 
 
 
 
 
 
 
 
 
101
  <?php
 
 
102
 
103
  } // END form()
104
 
@@ -116,9 +148,14 @@ class WP_Editor_Widget extends WP_Widget {
116
 
117
  $instance = array();
118
 
119
- $instance['title'] = ( !empty($new_instance['title']) ? strip_tags( $new_instance['title']) : '' );
120
- $instance['content'] = ( !empty($new_instance['content']) ? $new_instance['content'] : '' );
121
- $instance['output_title'] = ( isset($new_instance['output_title']) && $new_instance['output_title'] == "1" ? 1 : 0 );
 
 
 
 
 
122
 
123
  do_action( 'wp_editor_widget_update', $new_instance, $instance );
124
 
1
  <?php
2
  //avoid direct calls to this file
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
  header( 'Status: 403 Forbidden' );
5
  header( 'HTTP/1.1 403 Forbidden' );
6
  exit();
15
  * Register widget with WordPress.
16
  */
17
  public function __construct() {
18
+
19
+ // WPML support?
20
+ if ( function_exists( 'icl_get_languages' ) ) {
21
+ $widget_name = esc_html__( 'Multilingual', 'wp-editor-widget' ) . ' ' . esc_html__( 'Rich text', 'wp-editor-widget' );
22
+ }
23
+ else {
24
+ $widget_name = esc_html__( 'Rich text', 'wp-editor-widget' );
25
+ }
26
 
27
  $widget_ops = apply_filters(
28
  'wp_editor_widget_ops',
31
  'description' => __( 'Arbitrary text, HTML or rich text through the standard WordPress visual editor.', 'wp-editor-widget' ),
32
  )
33
  );
34
+
35
  parent::__construct(
36
  'WP_Editor_Widget',
37
+ $widget_name,
38
  $widget_ops
39
  );
40
 
50
  */
51
  public function widget( $args, $instance ) {
52
 
 
 
53
  $title = apply_filters( 'wp_editor_widget_title', $instance['title'] );
54
  $output_title = apply_filters( 'wp_editor_widget_output_title', $instance['output_title'] );
55
  $content = apply_filters( 'wp_editor_widget_content', $instance['content'] );
56
+
57
+ $show = true;
58
+
59
+ // WPML support?
60
+ if ( function_exists( 'icl_get_languages' ) ) {
61
+ $language = apply_filters( 'wp_editor_widget_language', $instance['language'] );
62
+ $show = ($language == icl_get_current_language());
63
+ }
64
+
65
+ if ( $show ) {
66
+
67
+ $default_html = $args['before_widget'];
68
+
69
+ if ( '1' == $output_title && ! empty( $title ) ) {
70
+ $default_html .= $args['before_title'] . $title . $args['after_title'];
71
+ }
72
+
73
+ $default_html .= $content;
74
+
75
+ $default_html .= $args['after_widget'];
76
+
77
+ echo apply_filters( 'wp_editor_widget_html', $default_html, $args['id'], $instance, $args['before_widget'], $args['after_widget'], $output_title, $title, $args['before_title'], $args['after_title'], $content );
78
+
79
  }
 
 
 
 
80
 
81
  } // END widget()
82
 
89
  */
90
  public function form( $instance ) {
91
 
92
+ if ( isset( $instance['title'] ) ) {
93
  $title = $instance['title'];
94
  }
95
  else {
96
  $title = __( 'New title', 'wp-editor-widget' );
97
  }
98
 
99
+ if ( isset( $instance['content'] ) ) {
100
  $content = $instance['content'];
101
  }
102
  else {
103
+ $content = '';
104
  }
105
 
106
+ $output_title = ( isset( $instance['output_title'] ) && '1' == $instance['output_title'] ? true : false );
107
  ?>
108
+ <input type="hidden" id="<?php echo esc_attr( $this->get_field_id( 'content' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'content' ) ); ?>" value="<?php echo esc_attr( $content ); ?>">
109
  <p>
110
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'wp-editor-widget' ); ?>:</label>
111
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
112
  </p>
113
  <p>
114
+ <a href="javascript:WPEditorWidget.showEditor('<?php echo esc_attr( $this->get_field_id( 'content' ) ); ?>');" class="button"><?php _e( 'Edit content', 'wp-editor-widget' ) ?></a>
115
  </p>
116
  <p>
117
+ <label for="<?php echo esc_attr( $this->get_field_id( 'output_title' ) ); ?>">
118
+ <input type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'output_title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'output_title' ) ); ?>" value="1" <?php checked( $output_title, true ) ?>> <?php _e( 'Output title', 'wp-editor-widget' ); ?>
119
  </label>
120
  </p>
121
+ <?php if ( function_exists( 'icl_get_languages' ) ) : $languages = icl_get_languages( 'skip_missing=0&orderby=code' ); ?>
122
+ <label for="<?php echo esc_attr( $this->get_field_id( 'language' ) ); ?>">
123
+ <?php _e( 'Language', 'wp-editor-widget' ); ?>:
124
+ <select id="<?php echo esc_attr( $this->get_field_id( 'language' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'language' ) ); ?>">
125
+ <?php foreach ( $languages as $id => $lang ) : ?>
126
+ <option value="<?php echo esc_attr( $lang['language_code'] ) ?>" <?php selected( $instance['language'], $lang['language_code'] ) ?>><?php echo esc_attr( $lang['native_name'] ) ?></option>
127
+ <?php endforeach; ?>
128
+ </select>
129
+ </label>
130
+ <?php endif; ?>
131
  <?php
132
+
133
+ do_action( 'wp_editor_widget_form', $this, $instance );
134
 
135
  } // END form()
136
 
148
 
149
  $instance = array();
150
 
151
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '' );
152
+ $instance['content'] = ( ! empty( $new_instance['content'] ) ? $new_instance['content'] : '' );
153
+ $instance['output_title'] = ( isset( $new_instance['output_title'] ) && '1' == $new_instance['output_title'] ? 1 : 0 );
154
+
155
+ // WPML support
156
+ if ( function_exists( 'icl_get_languages' ) ) {
157
+ $instance['language'] = ( isset( $new_instance['language'] ) ? $new_instance['language'] : '');
158
+ }
159
 
160
  do_action( 'wp_editor_widget_update', $new_instance, $instance );
161
 
langs/wp-editor-widget-da_DK.mo CHANGED
Binary file
langs/wp-editor-widget-da_DK.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: WP Editor Widget 0.3.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-08-08 11:00+0100\n"
6
- "PO-Revision-Date: 2015-04-22 06:22+0100\n"
7
  "Last-Translator: Ryan Skov <ryan@postkazzen.dk>\n"
8
  "Language-Team: Feed Me A Stray Cat <david.martensson@gmail.com>\n"
9
  "Language: da\n"
@@ -11,9 +11,10 @@ msgstr ""
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e;esc_attr__;"
14
- "esc_html__;esc_html_e;_x;_ex;esc_attr_x;esc_html_x;_n;_nx;_n_noop;_nx_noop\n"
 
15
  "X-Poedit-Basepath: .\n"
16
- "X-Generator: Poedit 1.5.5\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
  #: wp-editor-widget.php:72
@@ -34,15 +35,14 @@ msgid ""
34
  "editor."
35
  msgstr ""
36
  "Vilkårlig tekst, HTML eller RTF via standard WordPress visuel editor."
37
- ""
38
 
39
  #: wp-editor-widget.php:158
40
  msgid "New title"
41
- msgstr "Ny tittel"
42
 
43
  #: wp-editor-widget.php:172
44
  msgid "Title"
45
- msgstr "Tittel"
46
 
47
  #: wp-editor-widget.php:176
48
  msgid "Edit content"
@@ -50,7 +50,7 @@ msgstr "Rediger indhold"
50
 
51
  #: wp-editor-widget.php:180
52
  msgid "Output title"
53
- msgstr "Vis tittel"
54
 
55
  msgid "Language"
56
  msgstr "Sprog"
3
  "Project-Id-Version: WP Editor Widget 0.3.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-08-08 11:00+0100\n"
6
+ "PO-Revision-Date: 2017-03-17 20:46+0100\n"
7
  "Last-Translator: Ryan Skov <ryan@postkazzen.dk>\n"
8
  "Language-Team: Feed Me A Stray Cat <david.martensson@gmail.com>\n"
9
  "Language: da\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e;esc_attr__;"
14
+ "esc_html__;esc_html_e;_x;_ex;esc_attr_x;esc_html_x;_n;_nx;_n_noop;"
15
+ "_nx_noop\n"
16
  "X-Poedit-Basepath: .\n"
17
+ "X-Generator: Poedit 1.8.7\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
 
20
  #: wp-editor-widget.php:72
35
  "editor."
36
  msgstr ""
37
  "Vilkårlig tekst, HTML eller RTF via standard WordPress visuel editor."
 
38
 
39
  #: wp-editor-widget.php:158
40
  msgid "New title"
41
+ msgstr "Ny titel"
42
 
43
  #: wp-editor-widget.php:172
44
  msgid "Title"
45
+ msgstr "Titel"
46
 
47
  #: wp-editor-widget.php:176
48
  msgid "Edit content"
50
 
51
  #: wp-editor-widget.php:180
52
  msgid "Output title"
53
+ msgstr "Vis titel"
54
 
55
  msgid "Language"
56
  msgstr "Sprog"
langs/wp-editor-widget-sv_SE.mo CHANGED
Binary file
langs/wp-editor-widget-sv_SE.po CHANGED
@@ -1,34 +1,31 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WP Editor Widget 0.3.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2013-08-08 11:00+0100\n"
6
- "PO-Revision-Date: 2013-08-08 11:01+0100\n"
7
- "Last-Translator: DMR <david.martensson@gmail.com>\n"
8
  "Language-Team: Feed Me A Stray Cat <david.martensson@gmail.com>\n"
9
  "Language: sv_SE\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;__;_e;esc_attr_e;esc_attr__;"
14
- "esc_html__;esc_html_e;_x;_ex;esc_attr_x;esc_html_x;_n;_nx;_n_noop;_nx_noop\n"
 
15
  "X-Poedit-Basepath: .\n"
16
- "X-Generator: Poedit 1.5.5\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
- #: wp-editor-widget.php:72
20
- msgid "Close"
21
- msgstr "Stäng"
22
-
23
- #: wp-editor-widget.php:81
24
- msgid "Save and close"
25
- msgstr "Spara och stäng"
26
 
27
- #: wp-editor-widget.php:113
28
  msgid "Rich text"
29
  msgstr "Formaterad text"
30
 
31
- #: wp-editor-widget.php:114
32
  msgid ""
33
  "Arbitrary text, HTML or rich text through the standard WordPress visual "
34
  "editor."
@@ -36,22 +33,34 @@ msgstr ""
36
  "Godtycklig text, HTML eller formaterad text via WordPress visuella "
37
  "textredigerare."
38
 
39
- #: wp-editor-widget.php:158
40
  msgid "New title"
41
  msgstr "Ny titel"
42
 
43
- #: wp-editor-widget.php:172
44
  msgid "Title"
45
  msgstr "Tite"
46
 
47
- #: wp-editor-widget.php:176
48
  msgid "Edit content"
49
  msgstr "Redigera innehåll"
50
 
51
- #: wp-editor-widget.php:180
52
  msgid "Output title"
53
  msgstr "Skriv ut titel"
54
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  #~ msgid "WP Editor Widget"
56
  #~ msgstr "WP Editor Widget"
57
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: WP Editor Widget 0.6.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2017-02-15 21:51+0100\n"
6
+ "PO-Revision-Date: 2017-02-15 21:52+0100\n"
7
+ "Last-Translator: David Mårtensson <david.martensson@gmail.com>\n"
8
  "Language-Team: Feed Me A Stray Cat <david.martensson@gmail.com>\n"
9
  "Language: sv_SE\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;__;_e;esc_attr_e;esc_attr__;"
14
+ "esc_html__;esc_html_e;_x;_ex;esc_attr_x;esc_html_x;_n;_nx;_n_noop;"
15
+ "_nx_noop\n"
16
  "X-Poedit-Basepath: .\n"
17
+ "X-Generator: Poedit 1.8.8\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
 
20
+ #: classes/class-widget.php:21
21
+ msgid "Multilingual"
22
+ msgstr "Flerspråkig"
 
 
 
 
23
 
24
+ #: classes/class-widget.php:21 classes/class-widget.php:24
25
  msgid "Rich text"
26
  msgstr "Formaterad text"
27
 
28
+ #: classes/class-widget.php:31
29
  msgid ""
30
  "Arbitrary text, HTML or rich text through the standard WordPress visual "
31
  "editor."
33
  "Godtycklig text, HTML eller formaterad text via WordPress visuella "
34
  "textredigerare."
35
 
36
+ #: classes/class-widget.php:100
37
  msgid "New title"
38
  msgstr "Ny titel"
39
 
40
+ #: classes/class-widget.php:119
41
  msgid "Title"
42
  msgstr "Tite"
43
 
44
+ #: classes/class-widget.php:123
45
  msgid "Edit content"
46
  msgstr "Redigera innehåll"
47
 
48
+ #: classes/class-widget.php:127
49
  msgid "Output title"
50
  msgstr "Skriv ut titel"
51
 
52
+ #: classes/class-widget.php:132
53
+ msgid "Language"
54
+ msgstr "Språk"
55
+
56
+ #: wp-editor-widget.php:86
57
+ msgid "Close"
58
+ msgstr "Stäng"
59
+
60
+ #: wp-editor-widget.php:95
61
+ msgid "Save and close"
62
+ msgstr "Spara och stäng"
63
+
64
  #~ msgid "WP Editor Widget"
65
  #~ msgstr "WP Editor Widget"
66
 
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === WP Editor Widget ===
2
  Contributors: feedmeastraycat
3
- Tags: widget, wysiwyg, editor, rich text
4
  Requires at least: 3.5.1
5
- Tested up to: 4.7.4
6
- Stable tag: 0.5.5
7
  License: MIT
8
 
9
  WP Editor Widget adds a rich text widget where the content is edited using the standard WordPress visual editor.
@@ -39,6 +39,12 @@ Feel free to help with developement or issue reporting on [Github](https://githu
39
 
40
  == Changelog ==
41
 
 
 
 
 
 
 
42
  = 0.5.5 =
43
  * Added Danish translation *(Thanks to [@docryan](https://github.com/docryan))*
44
 
1
  === WP Editor Widget ===
2
  Contributors: feedmeastraycat
3
+ Tags: widget, wysiwyg, editor, rich text, wpml
4
  Requires at least: 3.5.1
5
+ Tested up to: 4.9.4
6
+ Stable tag: 0.6.0
7
  License: MIT
8
 
9
  WP Editor Widget adds a rich text widget where the content is edited using the standard WordPress visual editor.
39
 
40
  == Changelog ==
41
 
42
+ = 0.6.0 =
43
+ * Added support for WPML - Set the language for each Widget and only the ones for the current active language is output. *(Thanks to [@docryan](https://github.com/docryan))*
44
+ * Added filter `wp_editor_widget_html` - Makes it possible to change the full HTML output of the Widget through a plugin or a theme
45
+ * Added action `wp_editor_widget_form` - Makes it possibel to add custom form elements to the Widghet through a plugin or a theme
46
+ * Added Scrutinizer code quality check for Github and made some changes to get better score
47
+
48
  = 0.5.5 =
49
  * Added Danish translation *(Thanks to [@docryan](https://github.com/docryan))*
50
 
wp-editor-widget.php CHANGED
@@ -4,14 +4,14 @@ Plugin Name: WP Editor Widget
4
  Plugin URI: https://github.com/feedmeastraycat/wp-editor-widget
5
  Description: WP Editor Widget adds a WYSIWYG widget using the wp_editor().
6
  Author: David M&aring;rtensson, Odd Alice
7
- Version: 0.5.5
8
  Author URI: http://www.feedmeastraycat.net/
9
  Text Domain: wp-editor-widget
10
  Domain Path: /langs
11
  */
12
 
13
  //avoid direct calls to this file
14
- if ( !defined( 'ABSPATH' ) ) {
15
  header( 'Status: 403 Forbidden' );
16
  header( 'HTTP/1.1 403 Forbidden' );
17
  exit();
@@ -27,7 +27,7 @@ class WPEditorWidget {
27
  /**
28
  * @var string
29
  */
30
- const VERSION = "0.5.5";
31
 
32
  /**
33
  * Action: init
4
  Plugin URI: https://github.com/feedmeastraycat/wp-editor-widget
5
  Description: WP Editor Widget adds a WYSIWYG widget using the wp_editor().
6
  Author: David M&aring;rtensson, Odd Alice
7
+ Version: 0.6.0
8
  Author URI: http://www.feedmeastraycat.net/
9
  Text Domain: wp-editor-widget
10
  Domain Path: /langs
11
  */
12
 
13
  //avoid direct calls to this file
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
  header( 'Status: 403 Forbidden' );
16
  header( 'HTTP/1.1 403 Forbidden' );
17
  exit();
27
  /**
28
  * @var string
29
  */
30
+ const VERSION = '0.6.0';
31
 
32
  /**
33
  * Action: init
wp-editor-widget.pot CHANGED
@@ -1,8 +1,9 @@
 
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WP Editor Widget 0.3.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2013-08-08 11:00+0100\n"
6
  "PO-Revision-Date: 2013-08-08 11:00+0100\n"
7
  "Last-Translator: DMR <david.martensson@gmail.com>\n"
8
  "Language-Team: Feed Me A Stray Cat <david.martensson@gmail.com>\n"
@@ -11,41 +12,50 @@ msgstr ""
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e;esc_attr__;"
14
- "esc_html__;esc_html_e;_x;_ex;esc_attr_x;esc_html_x;_n;_nx;_n_noop;_nx_noop\n"
 
15
  "X-Poedit-Basepath: .\n"
16
- "X-Generator: Poedit 1.5.5\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
- #: wp-editor-widget.php:72
20
- msgid "Close"
21
- msgstr ""
22
-
23
- #: wp-editor-widget.php:81
24
- msgid "Save and close"
25
  msgstr ""
26
 
27
- #: wp-editor-widget.php:113
28
  msgid "Rich text"
29
  msgstr ""
30
 
31
- #: wp-editor-widget.php:114
32
  msgid ""
33
  "Arbitrary text, HTML or rich text through the standard WordPress visual "
34
  "editor."
35
  msgstr ""
36
 
37
- #: wp-editor-widget.php:158
38
  msgid "New title"
39
  msgstr ""
40
 
41
- #: wp-editor-widget.php:172
42
  msgid "Title"
43
  msgstr ""
44
 
45
- #: wp-editor-widget.php:176
46
  msgid "Edit content"
47
  msgstr ""
48
 
49
- #: wp-editor-widget.php:180
50
  msgid "Output title"
51
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
  msgid ""
3
  msgstr ""
4
+ "Project-Id-Version: WP Editor Widget 0.6.0\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2017-02-15 21:53+0100\n"
7
  "PO-Revision-Date: 2013-08-08 11:00+0100\n"
8
  "Last-Translator: DMR <david.martensson@gmail.com>\n"
9
  "Language-Team: Feed Me A Stray Cat <david.martensson@gmail.com>\n"
12
  "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
14
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e;esc_attr__;"
15
+ "esc_html__;esc_html_e;_x;_ex;esc_attr_x;esc_html_x;_n;_nx;_n_noop;"
16
+ "_nx_noop\n"
17
  "X-Poedit-Basepath: .\n"
18
+ "X-Generator: Poedit 1.8.8\n"
19
  "X-Poedit-SearchPath-0: .\n"
20
 
21
+ #: classes/class-widget.php:21
22
+ msgid "Multilingual"
 
 
 
 
23
  msgstr ""
24
 
25
+ #: classes/class-widget.php:21 classes/class-widget.php:24
26
  msgid "Rich text"
27
  msgstr ""
28
 
29
+ #: classes/class-widget.php:31
30
  msgid ""
31
  "Arbitrary text, HTML or rich text through the standard WordPress visual "
32
  "editor."
33
  msgstr ""
34
 
35
+ #: classes/class-widget.php:100
36
  msgid "New title"
37
  msgstr ""
38
 
39
+ #: classes/class-widget.php:119
40
  msgid "Title"
41
  msgstr ""
42
 
43
+ #: classes/class-widget.php:123
44
  msgid "Edit content"
45
  msgstr ""
46
 
47
+ #: classes/class-widget.php:127
48
  msgid "Output title"
49
  msgstr ""
50
+
51
+ #: classes/class-widget.php:132
52
+ msgid "Language"
53
+ msgstr ""
54
+
55
+ #: wp-editor-widget.php:86
56
+ msgid "Close"
57
+ msgstr ""
58
+
59
+ #: wp-editor-widget.php:95
60
+ msgid "Save and close"
61
+ msgstr ""