Rich Text Tags - Version 1.2

Version Description

  • Fixed issue where toggling between rich text and HTML editors removed paragraphs and line breaks (issue 473880)
Download this release

Release Info

Developer katzwebdesign
Plugin Icon 128x128 Rich Text Tags
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

Files changed (3) hide show
  1. kws_rt_taxonomy.js +2 -1
  2. readme.txt +18 -6
  3. rich-text-tags.php +25 -13
kws_rt_taxonomy.js CHANGED
@@ -12,7 +12,8 @@ jQuery(document).ready(function($) {
12
 
13
  $('label[for="description"],label[for="category_description"]').parent().append('<div id="toggleRichText" class="hide-if-no-js"><p><a href="#">Toggle Rich Text Editor</a></p></div>');
14
 
15
- $('#toggleRichText').click(function() {
 
16
  tinyMCE.execCommand('mceToggleEditor',false,'description');
17
  tinyMCE.execCommand('mceToggleEditor',false,'category_description');
18
  return false;
12
 
13
  $('label[for="description"],label[for="category_description"]').parent().append('<div id="toggleRichText" class="hide-if-no-js"><p><a href="#">Toggle Rich Text Editor</a></p></div>');
14
 
15
+ $('#toggleRichText').click(function(e) {
16
+ e.preventDefault();
17
  tinyMCE.execCommand('mceToggleEditor',false,'description');
18
  tinyMCE.execCommand('mceToggleEditor',false,'category_description');
19
  return false;
readme.txt CHANGED
@@ -3,29 +3,41 @@ Contributors: katzwebdesign
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zackkatz%40gmail%2ecom&item_name=Rich%20Text%20Tags&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
4
  Tags: tag, tags, taxonomy, taxonomies, category, categories, category description, rich text category, editor, rich text, description, tag description, taxonomy description, rich text, wysiwyg, tinyMCE, SEO, search engine optimization
5
  Requires at least: 2.6
6
- Tested up to: 2.9.1
7
  Stable tag: trunk
8
 
9
  The Rich Text Tags Plugin allows you to edit tag, category, and taxonomy descriptions using Wordpress' built in WYSIWYG editor.
10
 
11
  == Description ==
12
 
 
 
13
  ### A TinyMCE Editor for Tags, Categories, and Taxonomies ###
14
  The Rich Text Tags Plugin allows you to edit tag descriptions, category descriptions, and taxonomy descriptions using Wordpress' built in rich-text editor. Switch between WYSIWYG and HTML editing modes with the click of a link. Use the WordPress uploader to insert images from your computer or site's Media Library.
15
 
16
- Use the PHP functions `tag_description()` and `category_description()` in your theme to show the descriptions. To learn how to show taxonomy descriptions, [read more on the plugin page](http://www.seodenver.com/rich-text-tags/).
17
 
 
18
  * Edit tag descriptions with tinyMCE's WYSIWYG editor
19
- * Works with custom taxonomies using [Yoast's Simple Taxonomies Plugin](http://yoast.com/wordpress/simple-taxonomies/)
20
  * Capability to turn off rich text editing with a click, so you can edit the HTML
21
 
 
22
  == Installation ==
23
 
24
  * Upload the `rich-text-tags` folder to the `/wp-content/plugins/` directory
25
  * Activate the plugin through the 'Plugins' menu in WordPress
26
 
 
 
 
 
 
27
  == Upgrade Notice ==
28
 
 
 
 
29
  = 1.1 =
30
  * Added support for WordPress 3.0+
31
  * Improved code structure
@@ -33,6 +45,9 @@ Use the PHP functions `tag_description()` and `category_description()` in your t
33
 
34
  == Changelog ==
35
 
 
 
 
36
  = 1.1 =
37
  * Added support for WordPress 3.0+
38
  * Improved code structure
@@ -61,6 +76,3 @@ Use the PHP functions `tag_description()` and `category_description()` in your t
61
 
62
  1. How the rich text editor looks in the Edit Tags Page
63
  2. The editor with rich text editing disabled
64
-
65
- == License ==
66
- * This plugin is released under a GPL license.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zackkatz%40gmail%2ecom&item_name=Rich%20Text%20Tags&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
4
  Tags: tag, tags, taxonomy, taxonomies, category, categories, category description, rich text category, editor, rich text, description, tag description, taxonomy description, rich text, wysiwyg, tinyMCE, SEO, search engine optimization
5
  Requires at least: 2.6
6
+ Tested up to: 3.0.1
7
  Stable tag: trunk
8
 
9
  The Rich Text Tags Plugin allows you to edit tag, category, and taxonomy descriptions using Wordpress' built in WYSIWYG editor.
10
 
11
  == Description ==
12
 
13
+ > __Support for this plugin & documentation on the <a href="http://www.seodenver.com/rich-text-tags/">official plugin page</a>__
14
+
15
  ### A TinyMCE Editor for Tags, Categories, and Taxonomies ###
16
  The Rich Text Tags Plugin allows you to edit tag descriptions, category descriptions, and taxonomy descriptions using Wordpress' built in rich-text editor. Switch between WYSIWYG and HTML editing modes with the click of a link. Use the WordPress uploader to insert images from your computer or site's Media Library.
17
 
18
+ Use the PHP functions `tag_description()` and `category_description()` in your theme to show the descriptions. To learn how to show taxonomy descriptions, <a href="http://www.seodenver.com/rich-text-tags/" rel="nofollow">read more on the plugin page</a>.
19
 
20
+ <h4>Features</h4>
21
  * Edit tag descriptions with tinyMCE's WYSIWYG editor
22
+ * Works with custom taxonomies (and custom post types, introduced in WP 3.0)
23
  * Capability to turn off rich text editing with a click, so you can edit the HTML
24
 
25
+
26
  == Installation ==
27
 
28
  * Upload the `rich-text-tags` folder to the `/wp-content/plugins/` directory
29
  * Activate the plugin through the 'Plugins' menu in WordPress
30
 
31
+ == Frequently Asked Questions ==
32
+
33
+ = What is the license of this plugin? =
34
+ * This plugin is released under a GPL license.
35
+
36
  == Upgrade Notice ==
37
 
38
+ = 1.2 =
39
+ * Fixed issue where toggling between rich text and HTML editors removed paragraphs and line breaks (issue <a href="http://wordpress.org/support/topic/473880" rel="nofollow">473880</a>)
40
+
41
  = 1.1 =
42
  * Added support for WordPress 3.0+
43
  * Improved code structure
45
 
46
  == Changelog ==
47
 
48
+ = 1.2 =
49
+ * Fixed issue where toggling between rich text and HTML editors removed paragraphs and line breaks (issue <a href="http://wordpress.org/support/topic/473880" rel="nofollow">473880</a>)
50
+
51
  = 1.1 =
52
  * Added support for WordPress 3.0+
53
  * Improved code structure
76
 
77
  1. How the rich text editor looks in the Edit Tags Page
78
  2. The editor with rich text editing disabled
 
 
 
rich-text-tags.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Rich Text Tags, Categories, and Taxonomies
4
  Plugin URI: http://www.seodenver.com/rich-text-tags/
5
  Description: This plugin offers rich text editing capabilities for descriptions of tags, categories, and taxonomies.
6
  Author: Katz Web Services, Inc.
7
- Version: 1.1
8
  Author URI: http://www.katzwebservices.com
9
  */
10
  /*
@@ -48,8 +48,8 @@ function kws_rich_text_tags() {
48
  wp_enqueue_script('post');
49
  //if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) return;
50
  if(floatval($GLOBALS['wp_version']) >= 2.7) {
 
51
  wp_enqueue_script('jquery');
52
- wp_enqueue_script('editor');
53
  wp_enqueue_script('thickbox');
54
  add_action('admin_head','wp_tiny_mce');
55
  } else {
@@ -72,6 +72,9 @@ function kws_rich_text_tags() {
72
  }
73
  // add_action( 'media_buttons', 'media_buttons' );
74
  }
 
 
 
75
  if($GLOBALS['pagenow'] == 'categories.php' && $_REQUEST['action'] == 'edit') { // (!isset($_REQUEST['action']) || $_REQUEST['action'] == 'edit')) {
76
  add_action('edit_category_form_fields','kws_show_media_upload'); // Add link to disable Rich Text
77
  add_action('edit_category','kws_rt_category_save');
@@ -82,9 +85,22 @@ function kws_rich_text_tags() {
82
  function kws_rt_taxonomy_load_mce() {
83
  $kwsScript = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)).'kws_rt_taxonomy.js';
84
  wp_enqueue_style( 'thickbox' );
85
- wp_enqueue_script('kws_rte',$kwsScript);
86
  }
87
  function kws_rt_taxonomy_scripts() {
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  echo '<link rel="stylesheet" href="'.WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)).'kws_rt_taxonomy.css" type="text/css" media="all" />' . "\n";
89
  }
90
 
@@ -134,18 +150,14 @@ EOF;
134
  // Remove XHTML filtering from descriptions
135
  remove_filter( 'pre_term_description', 'wp_filter_kses' );
136
  remove_filter( 'term_description', 'wp_kses_data' );
137
- }
138
-
139
- add_action('init', 'kws_rt_remove_filter');
140
- function kws_rt_remove_filter($array) {
141
- if ( is_admin() || defined('DOING_AJAX') ) {
142
- if ( current_user_can('manage_categories') )
143
  remove_filter('pre_term_description', 'wp_filter_kses');
 
 
144
  }
145
- if( $GLOBALS['pagenow'] == 'edit-tags.php' && $_REQUEST['action'] == 'edit' ||
146
- $GLOBALS['pagenow'] == 'categories.php' && $_REQUEST['action'] == 'edit') {
147
- }
148
- return $array;
149
  }
150
 
151
  ?>
4
  Plugin URI: http://www.seodenver.com/rich-text-tags/
5
  Description: This plugin offers rich text editing capabilities for descriptions of tags, categories, and taxonomies.
6
  Author: Katz Web Services, Inc.
7
+ Version: 1.2
8
  Author URI: http://www.katzwebservices.com
9
  */
10
  /*
48
  wp_enqueue_script('post');
49
  //if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) return;
50
  if(floatval($GLOBALS['wp_version']) >= 2.7) {
51
+ // wp_enqueue_script('tiny_mce');
52
  wp_enqueue_script('jquery');
 
53
  wp_enqueue_script('thickbox');
54
  add_action('admin_head','wp_tiny_mce');
55
  } else {
72
  }
73
  // add_action( 'media_buttons', 'media_buttons' );
74
  }
75
+
76
+ add_action('init', 'kws_rt_remove_filter');
77
+
78
  if($GLOBALS['pagenow'] == 'categories.php' && $_REQUEST['action'] == 'edit') { // (!isset($_REQUEST['action']) || $_REQUEST['action'] == 'edit')) {
79
  add_action('edit_category_form_fields','kws_show_media_upload'); // Add link to disable Rich Text
80
  add_action('edit_category','kws_rt_category_save');
85
  function kws_rt_taxonomy_load_mce() {
86
  $kwsScript = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)).'kws_rt_taxonomy.js';
87
  wp_enqueue_style( 'thickbox' );
88
+ wp_enqueue_script('kws_rte',$kwsScript);
89
  }
90
  function kws_rt_taxonomy_scripts() {
91
+ global $pagenow;
92
+ $array = array();
93
+ if( $pagenow == 'edit-tags.php' && $_REQUEST['action'] == 'edit' ||
94
+ $pagenow == 'categories.php' && $_REQUEST['action'] == 'edit') {
95
+ if( $pagenow == 'edit-tags.php' && $_REQUEST['action'] == 'edit' ) {
96
+ $array['editor_selector'] = 'description';
97
+ } else {
98
+ $array['editor_selector'] = 'category_description';
99
+ }
100
+ }
101
+ if(function_exists('wp_tiny_mce')) {
102
+ wp_tiny_mce(false, $array);
103
+ }
104
  echo '<link rel="stylesheet" href="'.WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)).'kws_rt_taxonomy.css" type="text/css" media="all" />' . "\n";
105
  }
106
 
150
  // Remove XHTML filtering from descriptions
151
  remove_filter( 'pre_term_description', 'wp_filter_kses' );
152
  remove_filter( 'term_description', 'wp_kses_data' );
153
+
154
+ function kws_rt_remove_filter($array) {
155
+ global $pagenow;
156
+ if (( is_admin() || defined('DOING_AJAX') ) && current_user_can('manage_categories')) {
 
 
157
  remove_filter('pre_term_description', 'wp_filter_kses');
158
+ }
159
+ return $array;
160
  }
 
 
 
 
161
  }
162
 
163
  ?>