WP Editor Widget - Version 0.1.1

Version Description

  • CSS fix for widget editor close button
Download this release

Release Info

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

Code changes from version 0.1.0 to 0.1.1

Files changed (3) hide show
  1. assets/css/admin.css +1 -1
  2. readme.txt +13 -1
  3. wp-editor-widget.php +22 -10
assets/css/admin.css CHANGED
@@ -34,7 +34,7 @@
34
  background-position: -100px 0;
35
  }
36
  #wp-editor-widget-container .icon {
37
- background-image: url(../../../wp-includes/images/uploader-icons.png);
38
  background-repeat: no-repeat;
39
  }
40
  #wp-editor-widget-container .close:active {
34
  background-position: -100px 0;
35
  }
36
  #wp-editor-widget-container .icon {
37
+ background-image: url(../../../../wp-includes/images/uploader-icons.png);
38
  background-repeat: no-repeat;
39
  }
40
  #wp-editor-widget-container .close:active {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: feedmeastraycat
3
  Tags: widget, wysiwyg, editor
4
  Requires at least: 3.5.1
5
  Tested up to: 3.5.1
6
- Stable tag: 0.1.0
7
  License: MIT
8
 
9
  WP Editor Widget adds a WYSIWYG widget using the wp_editor().
@@ -13,6 +13,15 @@ License: MIT
13
  This plugin adds a WYSIWYG widget using the WP core function wp_editor() without
14
  adding a custom post type for each widget.
15
 
 
 
 
 
 
 
 
 
 
16
  == Installation ==
17
 
18
  1. Extract the ZIP file and move the folder "wp-editor-widget", with it contents,
@@ -21,5 +30,8 @@ adding a custom post type for each widget.
21
 
22
  == Changelog ==
23
 
 
 
 
24
  = 0.1.0 =
25
  * First stable proof of concept version.
3
  Tags: widget, wysiwyg, editor
4
  Requires at least: 3.5.1
5
  Tested up to: 3.5.1
6
+ Stable tag: 0.1.1
7
  License: MIT
8
 
9
  WP Editor Widget adds a WYSIWYG widget using the wp_editor().
13
  This plugin adds a WYSIWYG widget using the WP core function wp_editor() without
14
  adding a custom post type for each widget.
15
 
16
+ == Screenshots ==
17
+
18
+ 1. The plugin adds a widget called "WP Editor Widget".
19
+ 2. In the widget you can add a title, edit the content through a link and choose to output the title or not.
20
+ 3. When you click the "Edit content" link the WP Editor appears above the content, much like the Add media button. Click "Update and close" and then "Save" to save your content in the widget.
21
+ 4. The widget as displayed in Twenty Twelve.
22
+ 5. You can choose to display the title.
23
+ 6. The widget as displayed in Twenty Twelve with title output turned on.
24
+
25
  == Installation ==
26
 
27
  1. Extract the ZIP file and move the folder "wp-editor-widget", with it contents,
30
 
31
  == Changelog ==
32
 
33
+ = 0.1.1 =
34
+ * CSS fix for widget editor close button
35
+
36
  = 0.1.0 =
37
  * First stable proof of concept version.
wp-editor-widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Editor Widget
4
  Plugin URI: http://oddalice.com/
5
  Description: WP Editor Widget adds a WYSIWYG widget using the wp_editor().
6
  Author: David Mårtensson, Odd Alice
7
- Version: 0.1.0
8
  Author URI: http://www.feedmeastraycat.net/
9
  */
10
 
@@ -22,7 +22,15 @@ add_action('widgets_init', array('WPEditorWidget', 'widgets_init'));
22
  */
23
  class WPEditorWidget
24
  {
25
-
 
 
 
 
 
 
 
 
26
  const TEXTDOMAIN = "wpeditorwidget";
27
 
28
  /**
@@ -30,10 +38,10 @@ class WPEditorWidget
30
  */
31
  public static function admin_init()
32
  {
33
- wp_register_script('wp-editor-widget-js', plugins_url('assets/js/admin.js', __FILE__));
34
  wp_enqueue_script('wp-editor-widget-js');
35
 
36
- wp_register_style('wp-editor-widget-css', plugins_url('assets/css/admin.css', __FILE__));
37
  wp_enqueue_style('wp-editor-widget-css');
38
  }
39
 
@@ -75,7 +83,8 @@ class WPEditorWidget
75
  /**
76
  * Adds WP_Editor_Widget widget.
77
  */
78
- class WP_Editor_Widget extends WP_Widget {
 
79
 
80
  /**
81
  * Register widget with WordPress.
@@ -96,7 +105,8 @@ class WP_Editor_Widget extends WP_Widget {
96
  * @param array $args Widget arguments.
97
  * @param array $instance Saved values from database.
98
  */
99
- public function widget($args, $instance) {
 
100
  extract( $args );
101
 
102
  $title = apply_filters('wp_editor_widget_title', $instance['title']);
@@ -121,15 +131,16 @@ class WP_Editor_Widget extends WP_Widget {
121
  *
122
  * @param array $instance Previously saved values from database.
123
  */
124
- public function form( $instance ) {
125
- if (isset( $instance[ 'title' ])) {
 
126
  $title = $instance['title'];
127
  }
128
  else {
129
  $title = __('New title', WPEditorWidget::TEXTDOMAIN);
130
  }
131
 
132
- if (isset( $instance['content'])) {
133
  $content = $instance['content'];
134
  }
135
  else {
@@ -164,7 +175,8 @@ class WP_Editor_Widget extends WP_Widget {
164
  *
165
  * @return array Updated safe values to be saved.
166
  */
167
- public function update( $new_instance, $old_instance ) {
 
168
  $instance = array();
169
 
170
  $instance['title'] = (!empty($new_instance['title']) ? strip_tags( $new_instance['title']):'');
4
  Plugin URI: http://oddalice.com/
5
  Description: WP Editor Widget adds a WYSIWYG widget using the wp_editor().
6
  Author: David Mårtensson, Odd Alice
7
+ Version: 0.1.1
8
  Author URI: http://www.feedmeastraycat.net/
9
  */
10
 
22
  */
23
  class WPEditorWidget
24
  {
25
+
26
+ /**
27
+ * @var string
28
+ */
29
+ const VERSION = "0.1.1";
30
+
31
+ /**
32
+ * @var string
33
+ */
34
  const TEXTDOMAIN = "wpeditorwidget";
35
 
36
  /**
38
  */
39
  public static function admin_init()
40
  {
41
+ wp_register_script('wp-editor-widget-js', plugins_url('assets/js/admin.js', __FILE__), array('jquery'), self::VERSION);
42
  wp_enqueue_script('wp-editor-widget-js');
43
 
44
+ wp_register_style('wp-editor-widget-css', plugins_url('assets/css/admin.css', __FILE__), array(), self::VERSION);
45
  wp_enqueue_style('wp-editor-widget-css');
46
  }
47
 
83
  /**
84
  * Adds WP_Editor_Widget widget.
85
  */
86
+ class WP_Editor_Widget extends WP_Widget
87
+ {
88
 
89
  /**
90
  * Register widget with WordPress.
105
  * @param array $args Widget arguments.
106
  * @param array $instance Saved values from database.
107
  */
108
+ public function widget($args, $instance)
109
+ {
110
  extract( $args );
111
 
112
  $title = apply_filters('wp_editor_widget_title', $instance['title']);
131
  *
132
  * @param array $instance Previously saved values from database.
133
  */
134
+ public function form($instance)
135
+ {
136
+ if (isset($instance['title'])) {
137
  $title = $instance['title'];
138
  }
139
  else {
140
  $title = __('New title', WPEditorWidget::TEXTDOMAIN);
141
  }
142
 
143
+ if (isset($instance['content'])) {
144
  $content = $instance['content'];
145
  }
146
  else {
175
  *
176
  * @return array Updated safe values to be saved.
177
  */
178
+ public function update($new_instance, $old_instance)
179
+ {
180
  $instance = array();
181
 
182
  $instance['title'] = (!empty($new_instance['title']) ? strip_tags( $new_instance['title']):'');