Rich Text Tags - Version 1.8

Version Description

on April 11, 2016 =

  • Added compatibility with WordPress 4.5
  • Fixed translations
Download this release

Release Info

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

Code changes from version 1.7.3 to 1.8

languages/rich-text-tags.mo ADDED
Binary file
languages/rich-text-tags.po ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Rich Text Tags, Categories, and Taxonomies\n"
4
+ "POT-Creation-Date: 2016-04-11 18:51-0600\n"
5
+ "PO-Revision-Date: 2016-04-11 18:51-0600\n"
6
+ "Last-Translator: Katz Web Services, Inc. <support@katz.co>\n"
7
+ "Language-Team: Katz Web Services, Inc. <support@katz.co>\n"
8
+ "Language: en_US\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.5\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
16
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
17
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
18
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #: rich-text-tags.php:146
22
+ msgid "Biographical Info"
23
+ msgstr ""
24
+
25
+ #: rich-text-tags.php:152
26
+ msgid ""
27
+ "Share a little biographical information to fill out your profile. This may "
28
+ "be shown publicly."
29
+ msgstr ""
30
+
31
+ #: rich-text-tags.php:169
32
+ msgctxt "Taxonomy Description"
33
+ msgid "Description"
34
+ msgstr ""
35
+
36
+ #: rich-text-tags.php:174
37
+ msgid ""
38
+ "The description is not prominent by default, however some themes may show it."
39
+ msgstr ""
readme.txt CHANGED
@@ -1,9 +1,9 @@
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, terms, bio, biography, user, user data, user description
5
  Requires at least: 3.3
6
- Tested up to: 3.6
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.
@@ -13,9 +13,10 @@ The Rich Text Tags Plugin allows you to edit tag, category, and taxonomy descrip
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 WordPress 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>.
 
 
17
 
18
- <h4>Features</h4>
19
  * Edit term descriptions with WordPress's built-in WYSIWYG editor
20
  * Works with custom taxonomies (and custom post types, introduced in WP 3.0)
21
  * Now supports user biography fields!
@@ -35,6 +36,11 @@ Thanks, it's by <a href="http://www.flickr.com/photos/laurenmanning/5659535988/"
35
 
36
  == Upgrade Notice ==
37
 
 
 
 
 
 
38
  = 1.7.3 =
39
  * Fixed "Undefined variable" PHP warning <a href="http://wordpress.org/support/topic/plugin-rich-text-tags-debug-error-in-your-plugin">referenced here</a>
40
 
1
  === Rich Text Tags ===
2
+ Contributors: katzwebdesign,katzwebdesign
3
+ Donate link: https://gravityview.co
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, terms, bio, biography, user, user data, user description
5
  Requires at least: 3.3
6
+ Tested up to: 4.5
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.
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 WordPress functions `tag_description()` and `category_description()` in your theme to show the descriptions. To learn how to show taxonomy descriptions, <a href="https://katz.co/rich-text-tags/" rel="nofollow">read more on the plugin page</a>.
17
+
18
+ #### Features
19
 
 
20
  * Edit term descriptions with WordPress's built-in WYSIWYG editor
21
  * Works with custom taxonomies (and custom post types, introduced in WP 3.0)
22
  * Now supports user biography fields!
36
 
37
  == Upgrade Notice ==
38
 
39
+ = 1.8 on April 11, 2016 =
40
+
41
+ * Added compatibility with WordPress 4.5
42
+ * Fixed translations
43
+
44
  = 1.7.3 =
45
  * Fixed "Undefined variable" PHP warning <a href="http://wordpress.org/support/topic/plugin-rich-text-tags-debug-error-in-your-plugin">referenced here</a>
46
 
rich-text-tags.php CHANGED
@@ -1,14 +1,16 @@
1
  <?php
2
  /*
3
  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.7.3
8
- Author URI: http://www.katzwebservices.com
 
 
9
  */
10
 
11
- /* Copyright 2012 Katz Web Services, Inc. (email : info@katzwebservices.com)
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License as published by
@@ -28,51 +30,44 @@ Author URI: http://www.katzwebservices.com
28
 
29
  add_action('init', 'kws_rich_text_tags', 9999);
30
  function kws_rich_text_tags() {
31
-
32
  global $wpdb, $user, $current_user, $pagenow, $wp_version;
33
-
34
- load_plugin_textdomain( 'rich-text-tags', false, '/rich-text-tags/languages' ); // I18n
35
-
36
  // ADD EVENTS
37
- if(
38
- $pagenow == 'edit-tags.php' ||
39
- $pagenow == 'categories.php' ||
40
- $pagenow == 'media.php' ||
41
- $pagenow == 'profile.php' ||
42
- $pagenow == 'user-edit.php'
43
- ) {
44
- if(!user_can_richedit()) { return; }
45
 
46
  wp_enqueue_script('kws_rte', plugins_url('kws_rt_taxonomy.js', __FILE__), array('jquery'));
47
  wp_enqueue_style('editor-buttons');
48
 
49
  $taxonomies = get_taxonomies();
50
-
51
  foreach($taxonomies as $tax) {
52
  add_action($tax.'_edit_form_fields', 'kws_add_form');
53
  add_action($tax.'_add_form_fields', 'kws_add_form');
54
  }
55
-
56
  add_filter('attachment_fields_to_edit', 'kws_add_form_media', 1, 2);
57
  add_filter('media_post_single_attachment_fields_to_edit', 'kws_add_form_media', 1, 2);
58
-
59
  if($pagenow == 'edit-tags.php' && isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit' && empty($_REQUEST['taxonomy'])) {
60
  add_action('edit_term','kws_rt_taxonomy_save');
61
  }
62
-
63
  foreach ( array( 'pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description' ) as $filter ) {
64
  remove_filter( $filter, 'wp_filter_kses' );
65
  }
66
-
67
  add_action('show_user_profile', 'kws_add_form', 1);
68
  add_action('edit_user_profile', 'kws_add_form', 1);
69
  add_action('edit_user_profile_update', 'kws_rt_taxonomy_save');
70
-
71
  if(empty($_REQUEST['action'])) {
72
  add_filter('get_terms', 'kws_shorten_term_description');
73
  }
74
  }
75
-
76
  // Enable shortcodes in category, taxonomy, tag descriptions
77
  if(function_exists('term_description')) {
78
  add_filter('term_description', 'do_shortcode');
@@ -90,18 +85,24 @@ function kws_rt_taxonomy_save() {
90
  }
91
  }
92
 
 
 
 
 
 
 
93
  function kws_add_form_media($form_fields, $post) {
94
-
95
  $form_fields['post_content']['input'] = 'html';
96
-
97
  // We remove the ' and " from the $name so it works for tinyMCE.
98
  $name = "attachments[$post->ID][post_content]";
99
 
100
  // Let's grab the editor.
101
  ob_start();
102
- wp_editor($post->post_content, $name,
103
  array(
104
- 'textarea_name' => $name,
105
  'editor_css' => kws_rtt_get_css(),
106
  )
107
  );
@@ -112,6 +113,10 @@ function kws_add_form_media($form_fields, $post) {
112
  return $form_fields;
113
  }
114
 
 
 
 
 
115
  function kws_rtt_get_css() {
116
  return '
117
  <style type="text/css">
@@ -124,13 +129,13 @@ function kws_rtt_get_css() {
124
 
125
  function kws_add_form($object = ''){
126
  global $pagenow;?>
127
-
128
  <style type="text/css">
129
  .quicktags-toolbar input { width:auto!important; }
130
  .wp-editor-area {border: none!important;}
131
  </style>
132
-
133
- <?php
134
  // This is a profile page
135
  if(is_a($object, 'WP_User')) {
136
  $content = html_entity_decode(get_user_meta($object->ID, 'description', true));
@@ -138,37 +143,37 @@ function kws_add_form($object = ''){
138
  ?>
139
  <table class="form-table rich-text-tags">
140
  <tr>
141
- <th><label for="description"><?php _e('Biographical Info'); ?></label></th>
142
- <td><?php wp_editor($content, $editor_id,
143
  array(
144
- 'textarea_name' => $editor_selector,
145
  'editor_css' => kws_rtt_get_css(),
146
  )); ?><br />
147
- <span class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></span></td>
148
  </tr>
149
  <?php
150
- }
151
  // This is a taxonomy
152
  else {
153
  $content = is_object($object) && isset($object->description) ? html_entity_decode($object->description) : '';
154
-
155
- if( in_array($pagenow, array('edit-tags.php')) ) {
156
  $editor_id = 'tag_description';
157
  $editor_selector = 'description';
158
  } else {
159
  $editor_id = $editor_selector = 'category_description';
160
  }
161
-
162
  ?>
163
  <tr class="form-field">
164
- <th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
165
  <td><?php wp_editor($content, $editor_id, array(
166
- 'textarea_name' => $editor_selector,
167
  'editor_css' => kws_rtt_get_css(),
168
  )); ?><br />
169
- <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
170
  </tr>
171
- <?php
172
 
173
  }
174
 
1
  <?php
2
  /*
3
  Plugin Name: Rich Text Tags, Categories, and Taxonomies
4
+ Plugin URI: https://katz.co/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.8
8
+ Author URI: https://katz.co
9
+ Text Domain: rich-text-tags
10
+ Domain Path: languages
11
  */
12
 
13
+ /* Copyright 2016 Katz Web Services, Inc. (email : info@katzwebservices.com)
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License as published by
30
 
31
  add_action('init', 'kws_rich_text_tags', 9999);
32
  function kws_rich_text_tags() {
33
+
34
  global $wpdb, $user, $current_user, $pagenow, $wp_version;
35
+
36
+ load_plugin_textdomain( 'rich-text-tags', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); // I18n
37
+
38
  // ADD EVENTS
39
+ if( user_can_richedit() && in_array( $pagenow, array( 'edit-tags.php', 'categories.php', 'media.php', 'term.php', 'profile.php', 'user-edit.php' ) ) ) {
 
 
 
 
 
 
 
40
 
41
  wp_enqueue_script('kws_rte', plugins_url('kws_rt_taxonomy.js', __FILE__), array('jquery'));
42
  wp_enqueue_style('editor-buttons');
43
 
44
  $taxonomies = get_taxonomies();
45
+
46
  foreach($taxonomies as $tax) {
47
  add_action($tax.'_edit_form_fields', 'kws_add_form');
48
  add_action($tax.'_add_form_fields', 'kws_add_form');
49
  }
50
+
51
  add_filter('attachment_fields_to_edit', 'kws_add_form_media', 1, 2);
52
  add_filter('media_post_single_attachment_fields_to_edit', 'kws_add_form_media', 1, 2);
53
+
54
  if($pagenow == 'edit-tags.php' && isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit' && empty($_REQUEST['taxonomy'])) {
55
  add_action('edit_term','kws_rt_taxonomy_save');
56
  }
57
+
58
  foreach ( array( 'pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description' ) as $filter ) {
59
  remove_filter( $filter, 'wp_filter_kses' );
60
  }
61
+
62
  add_action('show_user_profile', 'kws_add_form', 1);
63
  add_action('edit_user_profile', 'kws_add_form', 1);
64
  add_action('edit_user_profile_update', 'kws_rt_taxonomy_save');
65
+
66
  if(empty($_REQUEST['action'])) {
67
  add_filter('get_terms', 'kws_shorten_term_description');
68
  }
69
  }
70
+
71
  // Enable shortcodes in category, taxonomy, tag descriptions
72
  if(function_exists('term_description')) {
73
  add_filter('term_description', 'do_shortcode');
85
  }
86
  }
87
 
88
+ /**
89
+ * @param array $form_fields
90
+ * @param WP_Post $post
91
+ *
92
+ * @return mixed
93
+ */
94
  function kws_add_form_media($form_fields, $post) {
95
+
96
  $form_fields['post_content']['input'] = 'html';
97
+
98
  // We remove the ' and " from the $name so it works for tinyMCE.
99
  $name = "attachments[$post->ID][post_content]";
100
 
101
  // Let's grab the editor.
102
  ob_start();
103
+ wp_editor($post->post_content, $name,
104
  array(
105
+ 'textarea_name' => $name,
106
  'editor_css' => kws_rtt_get_css(),
107
  )
108
  );
113
  return $form_fields;
114
  }
115
 
116
+ /**
117
+ * Modify the Editor CSS
118
+ * @return string
119
+ */
120
  function kws_rtt_get_css() {
121
  return '
122
  <style type="text/css">
129
 
130
  function kws_add_form($object = ''){
131
  global $pagenow;?>
132
+
133
  <style type="text/css">
134
  .quicktags-toolbar input { width:auto!important; }
135
  .wp-editor-area {border: none!important;}
136
  </style>
137
+
138
+ <?php
139
  // This is a profile page
140
  if(is_a($object, 'WP_User')) {
141
  $content = html_entity_decode(get_user_meta($object->ID, 'description', true));
143
  ?>
144
  <table class="form-table rich-text-tags">
145
  <tr>
146
+ <th><label for="description"><?php esc_html_e('Biographical Info', 'rich-text-tags'); ?></label></th>
147
+ <td><?php wp_editor($content, $editor_id,
148
  array(
149
+ 'textarea_name' => $editor_selector,
150
  'editor_css' => kws_rtt_get_css(),
151
  )); ?><br />
152
+ <span class="description"><?php esc_html_e('Share a little biographical information to fill out your profile. This may be shown publicly.', 'rich-text-tags'); ?></span></td>
153
  </tr>
154
  <?php
155
+ }
156
  // This is a taxonomy
157
  else {
158
  $content = is_object($object) && isset($object->description) ? html_entity_decode($object->description) : '';
159
+
160
+ if( in_array($pagenow, array('edit-tags.php', 'term.php')) ) {
161
  $editor_id = 'tag_description';
162
  $editor_selector = 'description';
163
  } else {
164
  $editor_id = $editor_selector = 'category_description';
165
  }
166
+
167
  ?>
168
  <tr class="form-field">
169
+ <th scope="row" valign="top"><label for="description"><?php echo esc_html_x('Description', 'Taxonomy Description', 'rich-text-tags'); ?></label></th>
170
  <td><?php wp_editor($content, $editor_id, array(
171
+ 'textarea_name' => $editor_selector,
172
  'editor_css' => kws_rtt_get_css(),
173
  )); ?><br />
174
+ <span class="description"><?php esc_html_e('The description is not prominent by default, however some themes may show it.', 'rich-text-tags'); ?></span></td>
175
  </tr>
176
+ <?php
177
 
178
  }
179