Rich Text Tags - Version 1.3

Version Description

  • Added support for NextGen Gallery
  • Improved Media Buttons support by gathering up stray link buttons
  • Added shortcode functionality for term descriptions (tags, categories and taxonomies). Shortcodes will now work in these descriptions.
Download this release

Release Info

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

Code changes from version 1.2.1 to 1.3

Files changed (3) hide show
  1. kws_rt_taxonomy.js +10 -7
  2. readme.txt +11 -1
  3. rich-text-tags.php +21 -8
kws_rt_taxonomy.js CHANGED
@@ -5,21 +5,24 @@ var purl = '';
5
 
6
  jQuery(document).ready(function($) {
7
 
 
 
 
8
  // Add the Rich Text Editor to the "description" textarea
9
- tinyMCE.execCommand('mceAddControl',false,'description');
10
- tinyMCE.execCommand('mceAddControl',false,'category_description');
11
  tinyMCE.settings['save_callback'] = function (e,c,body) { return c; }
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;
20
  });
21
 
22
- var dPar = $("textarea#description, textarea#category_description").parent();
23
- $('#editor-toolbar').remove().prependTo(dPar);
 
 
24
 
25
  }); /* end ready() */
5
 
6
  jQuery(document).ready(function($) {
7
 
8
+ $("textarea#description, textarea#category_description").attr('id', 'content');
9
+ $("label[for='description'], label[for='category_description']").attr('for', 'content');
10
+
11
  // Add the Rich Text Editor to the "description" textarea
12
+ tinyMCE.execCommand('mceAddControl',false,'content');
 
13
  tinyMCE.settings['save_callback'] = function (e,c,body) { return c; }
14
 
15
+ $('label[for="content"]').parent().append('<div id="toggleRichText" class="hide-if-no-js"><p><a href="#">Toggle Rich Text Editor</a></p></div>');
16
 
17
  $('#toggleRichText').click(function(e) {
18
  e.preventDefault();
19
+ tinyMCE.execCommand('mceToggleEditor',false,'content');
 
20
  return false;
21
  });
22
 
23
+ // Move floating media buttons into the media buttons div
24
+ $('#editor-toolbar').remove().prependTo($("textarea#content").parent());
25
+ $('.wrap form a[href*=TB_inline]:has(img)').remove().appendTo('#media-buttons');
26
+ $('.wrap form a[href=#]:has(img)').remove().appendTo('#media-buttons');
27
 
28
  }); /* end ready() */
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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: 3.0.3
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.
@@ -35,6 +35,11 @@ Use the PHP functions `tag_description()` and `category_description()` in your t
35
 
36
  == Upgrade Notice ==
37
 
 
 
 
 
 
38
  = 1.2.1 =
39
  * Fixed whitespace from being stripped in HTML mode
40
 
@@ -48,6 +53,11 @@ Use the PHP functions `tag_description()` and `category_description()` in your t
48
 
49
  == Changelog ==
50
 
 
 
 
 
 
51
  = 1.2.1 =
52
  * Fixed whitespace from being stripped in HTML mode
53
 
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.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.
35
 
36
  == Upgrade Notice ==
37
 
38
+ = 1.3 =
39
+ * Added support for NextGen Gallery
40
+ * Improved Media Buttons support by gathering up stray link buttons
41
+ * Added shortcode functionality for term descriptions (tags, categories and taxonomies). Shortcodes will now work in these descriptions.
42
+
43
  = 1.2.1 =
44
  * Fixed whitespace from being stripped in HTML mode
45
 
53
 
54
  == Changelog ==
55
 
56
+ = 1.3 =
57
+ * Added support for NextGen Gallery
58
+ * Improved Media Buttons support by gathering up stray link buttons
59
+ * Added shortcode functionality for term descriptions (tags, categories and taxonomies). Shortcodes will now work in these descriptions.
60
+
61
  = 1.2.1 =
62
  * Fixed whitespace from being stripped in HTML mode
63
 
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.2.1
8
  Author URI: http://www.katzwebservices.com
9
  */
10
  /*
@@ -32,6 +32,8 @@ Author URI: http://www.katzwebservices.com
32
  along with this program; if not, write to the Free Software
33
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34
  */
 
 
35
  add_action('plugins_loaded', 'kws_rich_text_tags');
36
  function kws_rich_text_tags() {
37
 
@@ -45,7 +47,9 @@ function kws_rich_text_tags() {
45
  if(!user_can_richedit()) { return; }
46
 
47
  wp_enqueue_script('post');
 
48
  if(floatval($GLOBALS['wp_version']) >= 2.7) {
 
49
  wp_enqueue_script('jquery');
50
  wp_enqueue_script('thickbox');
51
  add_action('admin_head','wp_tiny_mce');
@@ -55,7 +59,9 @@ function kws_rich_text_tags() {
55
  wp_enqueue_script('quicktags');
56
  add_filter( 'tiny_mce_before_init', 'kws_rt_remove_filter');
57
  add_filter( 'tiny_mce_before_init', 'kws_rt_tinymce_settings');
 
58
  wp_enqueue_script('media');
 
59
  wp_enqueue_script('media-upload');
60
  wp_enqueue_script('swfupload-all');
61
  wp_enqueue_script('swfupload-handlers');
@@ -63,16 +69,23 @@ function kws_rich_text_tags() {
63
  add_action('init','kws_rt_taxonomy_load_mce');
64
  add_action('wp_print_scripts','kws_rt_taxonomy_scripts');
65
  }
66
-
67
  if($GLOBALS['pagenow'] == 'edit-tags.php' && $_REQUEST['action'] == 'edit') {
68
- if(isset($_REQUEST['taxonomy'])) {
69
- add_action(esc_attr($_REQUEST['taxonomy']).'_edit_form_fields', 'kws_show_media_upload');
70
- } else {
71
- add_action('edit_tag_form_fields','kws_show_media_upload'); // Add link to disable Rich Text
72
- add_action('edit_term','kws_rt_taxonomy_save');
73
- }
 
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')) {
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.3
8
  Author URI: http://www.katzwebservices.com
9
  */
10
  /*
32
  along with this program; if not, write to the Free Software
33
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34
  */
35
+
36
+
37
  add_action('plugins_loaded', 'kws_rich_text_tags');
38
  function kws_rich_text_tags() {
39
 
47
  if(!user_can_richedit()) { return; }
48
 
49
  wp_enqueue_script('post');
50
+ //if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) return;
51
  if(floatval($GLOBALS['wp_version']) >= 2.7) {
52
+ // wp_enqueue_script('tiny_mce');
53
  wp_enqueue_script('jquery');
54
  wp_enqueue_script('thickbox');
55
  add_action('admin_head','wp_tiny_mce');
59
  wp_enqueue_script('quicktags');
60
  add_filter( 'tiny_mce_before_init', 'kws_rt_remove_filter');
61
  add_filter( 'tiny_mce_before_init', 'kws_rt_tinymce_settings');
62
+
63
  wp_enqueue_script('media');
64
+ wp_enqueue_script( 'postbox' );
65
  wp_enqueue_script('media-upload');
66
  wp_enqueue_script('swfupload-all');
67
  wp_enqueue_script('swfupload-handlers');
69
  add_action('init','kws_rt_taxonomy_load_mce');
70
  add_action('wp_print_scripts','kws_rt_taxonomy_scripts');
71
  }
 
72
  if($GLOBALS['pagenow'] == 'edit-tags.php' && $_REQUEST['action'] == 'edit') {
73
+ if(isset($_REQUEST['taxonomy'])) {
74
+ add_action(esc_attr($_REQUEST['taxonomy']).'_edit_form_fields', 'kws_show_media_upload');
75
+ } else {
76
+ add_action('edit_tag_form_fields','kws_show_media_upload'); // Add link to disable Rich Text
77
+ add_action('edit_term','kws_rt_taxonomy_save');
78
+ }
79
+ // add_action( 'media_buttons', 'media_buttons' );
80
  }
81
 
82
+ // Enable shortcodes in category, taxonomy, tag descriptions
83
+ if(function_exists('term_description')) {
84
+ add_filter('term_description', 'do_shortcode');
85
+ } else {
86
+ add_filter('category_description', 'do_shortcode');
87
+ }
88
+
89
  add_action('init', 'kws_rt_remove_filter');
90
 
91
  if($GLOBALS['pagenow'] == 'categories.php' && $_REQUEST['action'] == 'edit') { // (!isset($_REQUEST['action']) || $_REQUEST['action'] == 'edit')) {