Rich Text Tags - Version 1.0.3

Version Description

  • Added editor uploader/media library capability
Download this release

Release Info

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

Code changes from version 1.0.2 to 1.0.3

kws_rt_taxonomy.js CHANGED
@@ -1,4 +1,4 @@
1
- // For use with Rich Text Tags & Taxonomy WordPress Plugin
2
 
3
  //this is for compatability with cforms
4
  var purl = '';
@@ -17,5 +17,8 @@ jQuery(function($) {
17
  tinyMCE.execCommand('mceToggleEditor',false,'category_description');
18
  return false;
19
  });
 
 
 
20
 
21
  }); /* end ready() */
1
+ // For use with Rich Text Tags, Categories, and Taxonomies WordPress Plugin
2
 
3
  //this is for compatability with cforms
4
  var purl = '';
17
  tinyMCE.execCommand('mceToggleEditor',false,'category_description');
18
  return false;
19
  });
20
+
21
+ var dPar = $("textarea#description, textarea#category_description").parent();
22
+ $('#editor-toolbar').remove().prependTo(dPar);
23
 
24
  }); /* end ready() */
readme.txt CHANGED
@@ -1,17 +1,17 @@
1
  === Rich Text Tags ===
2
  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
5
  Requires at least: 2.6
6
  Tested up to: 2.8.4
7
- Stable tag: 1.0.2
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
- ### WordPress now has 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.
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
 
@@ -31,12 +31,14 @@ Katz Web Services, Inc. is a Denver WordPress development and search engine opti
31
 
32
  == Changelog ==
33
 
 
 
 
34
  = 1.0.2 =
35
  * Improved Javascript to use jQuery
36
  * Improved placement of Toggle link
37
  * Added `remove_filter( 'pre_term_description', 'wp_filter_kses' );` code to allow for HTML in tag,
38
  category, and taxonomy descriptions -- since that's what this plugin does :-)
39
- *
40
 
41
  = 1.0.1 =
42
  * Updated the `readme.txt` file to make clearer
@@ -47,4 +49,5 @@ Katz Web Services, Inc. is a Denver WordPress development and search engine opti
47
 
48
  == Screenshots ==
49
 
50
- 1. How the rich text editor looks in the Edit Tags Page
 
1
  === Rich Text Tags ===
2
  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.8.4
7
+ Stable tag: 1.0.3
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
 
31
 
32
  == Changelog ==
33
 
34
+ = 1.0.3 =
35
+ * Added editor uploader/media library capability
36
+
37
  = 1.0.2 =
38
  * Improved Javascript to use jQuery
39
  * Improved placement of Toggle link
40
  * Added `remove_filter( 'pre_term_description', 'wp_filter_kses' );` code to allow for HTML in tag,
41
  category, and taxonomy descriptions -- since that's what this plugin does :-)
 
42
 
43
  = 1.0.1 =
44
  * Updated the `readme.txt` file to make clearer
49
 
50
  == Screenshots ==
51
 
52
+ 1. How the rich text editor looks in the Edit Tags Page
53
+ 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.0.2
8
  Author URI: http://www.katzwebdesign.net
9
  */
10
  /*
@@ -31,13 +31,15 @@ Author URI: http://www.katzwebdesign.net
31
  along with this program; if not, write to the Free Software
32
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33
  */
34
-
35
 
36
  // ADD EVENTS
37
  if(
38
  $GLOBALS['pagenow'] == 'edit-tags.php' && $_REQUEST['action'] == 'edit' ||
39
  $GLOBALS['pagenow'] == 'categories.php' && $_REQUEST['action'] == 'edit' //(!isset($_REQUEST['action']) || $_REQUEST['action'] == 'edit')
40
  ) {
 
 
41
  if(floatval($GLOBALS['wp_version']) >= 2.7) {
42
  wp_enqueue_script('jquery');
43
  wp_enqueue_script('editor');
@@ -46,24 +48,29 @@ $GLOBALS['pagenow'] == 'categories.php' && $_REQUEST['action'] == 'edit' //(!iss
46
  } else {
47
  wp_enqueue_script('tiny_mce');
48
  }
 
 
 
 
 
49
  add_action('init','kws_rt_taxonomy_load_mce');
50
  add_action('wp_print_scripts','kws_rt_taxonomy_scripts');
51
  }
52
  if($GLOBALS['pagenow'] == 'edit-tags.php' && $_REQUEST['action'] == 'edit') {
53
- //add_action('edit_tag_form_pre','show_disable_richtext'); // Add link to disable Rich Text
54
  add_action('edit_term','kws_rt_taxonomy_save');
 
55
  }
56
  if($GLOBALS['pagenow'] == 'categories.php' && $_REQUEST['action'] == 'edit') { // (!isset($_REQUEST['action']) || $_REQUEST['action'] == 'edit')) {
 
57
  add_action('edit_category','kws_rt_category_save');
58
  }
59
 
60
  // LOAD SCRIPTS
61
  function kws_rt_taxonomy_load_mce() {
62
  $kwsScript = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)).'kws_rt_taxonomy.js';
63
-
64
- //if ( file_exists($kwsScript) ) {
65
  wp_enqueue_script('kws_rte',$kwsScript);
66
- // }
67
  }
68
  function kws_rt_taxonomy_scripts() {
69
  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";
@@ -87,6 +94,31 @@ function kws_rt_category_save() {
87
  }
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  // Remove XHTML filtering from descriptions
91
  remove_filter( 'pre_term_description', 'wp_filter_kses' );
92
 
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.0.3
8
  Author URI: http://www.katzwebdesign.net
9
  */
10
  /*
31
  along with this program; if not, write to the Free Software
32
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33
  */
34
+ global $wpdb, $user, $current_user;
35
 
36
  // ADD EVENTS
37
  if(
38
  $GLOBALS['pagenow'] == 'edit-tags.php' && $_REQUEST['action'] == 'edit' ||
39
  $GLOBALS['pagenow'] == 'categories.php' && $_REQUEST['action'] == 'edit' //(!isset($_REQUEST['action']) || $_REQUEST['action'] == 'edit')
40
  ) {
41
+ wp_enqueue_script('post');
42
+ //if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) return;
43
  if(floatval($GLOBALS['wp_version']) >= 2.7) {
44
  wp_enqueue_script('jquery');
45
  wp_enqueue_script('editor');
48
  } else {
49
  wp_enqueue_script('tiny_mce');
50
  }
51
+ wp_enqueue_script('media');
52
+ wp_enqueue_script('media-upload');
53
+ wp_enqueue_script('swfupload-all');
54
+ wp_enqueue_script('swfupload-handlers');
55
+
56
  add_action('init','kws_rt_taxonomy_load_mce');
57
  add_action('wp_print_scripts','kws_rt_taxonomy_scripts');
58
  }
59
  if($GLOBALS['pagenow'] == 'edit-tags.php' && $_REQUEST['action'] == 'edit') {
60
+ add_action('edit_tag_form_fields','kws_show_media_upload'); // Add link to disable Rich Text
61
  add_action('edit_term','kws_rt_taxonomy_save');
62
+ // add_action( 'media_buttons', 'media_buttons' );
63
  }
64
  if($GLOBALS['pagenow'] == 'categories.php' && $_REQUEST['action'] == 'edit') { // (!isset($_REQUEST['action']) || $_REQUEST['action'] == 'edit')) {
65
+ add_action('edit_category_form_pre','kws_show_media_upload'); // Add link to disable Rich Text
66
  add_action('edit_category','kws_rt_category_save');
67
  }
68
 
69
  // LOAD SCRIPTS
70
  function kws_rt_taxonomy_load_mce() {
71
  $kwsScript = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)).'kws_rt_taxonomy.js';
72
+ wp_enqueue_style( 'thickbox' );
 
73
  wp_enqueue_script('kws_rte',$kwsScript);
 
74
  }
75
  function kws_rt_taxonomy_scripts() {
76
  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";
94
  }
95
  }
96
 
97
+ function kws_show_media_upload() {
98
+ global $post_ID, $temp_ID, $tag_ID;
99
+
100
+ $post_ID = $temp_ID = -1 * time();
101
+
102
+ $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);
103
+ $context = apply_filters('media_buttons_context', __('<div id="editor-toolbar"><div id="media-buttons" class="hide-if-no-js">Upload/Insert %s</div></div>'));
104
+ $media_upload_iframe_src = "media-upload.php?post_id=$uploading_iframe_ID";
105
+ $media_title = __('Add Media');
106
+ $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src&amp;type=image");
107
+ $image_title = __('Add an Image');
108
+ $video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src&amp;type=video");
109
+ $video_title = __('Add Video');
110
+ $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&amp;type=audio");
111
+ $audio_title = __('Add Audio');
112
+ $out = <<<EOF
113
+
114
+ <a href="{$image_upload_iframe_src}&amp;TB_iframe=true" id="add_image" class="thickbox" title='$image_title' onclick="return false;"><img src='images/media-button-image.gif' alt='$image_title' /></a>
115
+ <a href="{$video_upload_iframe_src}&amp;TB_iframe=true" id="add_video" class="thickbox" title='$video_title' onclick="return false;"><img src='images/media-button-video.gif' alt='$video_title' /></a>
116
+ <a href="{$audio_upload_iframe_src}&amp;TB_iframe=true" id="add_audio" class="thickbox" title='$audio_title' onclick="return false;"><img src='images/media-button-music.gif' alt='$audio_title' /></a>
117
+ <a href="{$media_upload_iframe_src}&amp;TB_iframe=true" id="add_media" class="thickbox" title='$media_title' onclick="return false;"><img src='images/media-button-other.gif' alt='$media_title' /></a>
118
+ EOF;
119
+ // echo $out;
120
+ printf($context, $out);
121
+ }
122
  // Remove XHTML filtering from descriptions
123
  remove_filter( 'pre_term_description', 'wp_filter_kses' );
124
 
screenshot-1.jpg CHANGED
Binary file
screenshot-2.jpg ADDED
Binary file