Version Description
- Added support for rich text editing user biography fields!
- Made load a little later for support of more taxonomies
Download this release
Release Info
Developer | katzwebdesign |
Plugin | Rich Text Tags |
Version | 1.6 |
Comparing to | |
See all releases |
Code changes from version 1.5.2 to 1.6
- kws_rt_taxonomy.js +5 -0
- readme.txt +10 -1
- rich-text-tags.php +52 -28
kws_rt_taxonomy.js
CHANGED
@@ -18,6 +18,11 @@ jQuery(document).ready(function($) {
|
|
18 |
$('.form-field').has('#category-description').remove();
|
19 |
$('.form-field').has('#description').remove();
|
20 |
|
|
|
|
|
|
|
|
|
|
|
21 |
// Make sure you're saving the latest content
|
22 |
$('input#submit').click(function(e) {
|
23 |
kwsTriggerSave();
|
18 |
$('.form-field').has('#category-description').remove();
|
19 |
$('.form-field').has('#description').remove();
|
20 |
|
21 |
+
|
22 |
+
var profileTable = $('.user-edit-php .form-table, .profile-php .form-table').not('.rich-text-tags').has('textarea#description');
|
23 |
+
profileTable.prev('h3').insertBefore('table.rich-text-tags');
|
24 |
+
profileTable.remove();
|
25 |
+
|
26 |
// Make sure you're saving the latest content
|
27 |
$('input#submit').click(function(e) {
|
28 |
kwsTriggerSave();
|
readme.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
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¤cy_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
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.3.1
|
7 |
Stable tag: trunk
|
@@ -20,6 +20,7 @@ Use the WordPress functions `tag_description()` and `category_description()` in
|
|
20 |
<h4>Features</h4>
|
21 |
* Edit term descriptions with WordPress's built-in WYSIWYG editor
|
22 |
* Works with custom taxonomies (and custom post types, introduced in WP 3.0)
|
|
|
23 |
|
24 |
== Installation ==
|
25 |
|
@@ -36,6 +37,10 @@ Thanks, it's by <a href="http://www.flickr.com/photos/laurenmanning/5659535988/"
|
|
36 |
|
37 |
== Upgrade Notice ==
|
38 |
|
|
|
|
|
|
|
|
|
39 |
= 1.5.2 =
|
40 |
* Plugin now loads later to allow for custom taxonomies
|
41 |
|
@@ -80,6 +85,10 @@ Thanks, it's by <a href="http://www.flickr.com/photos/laurenmanning/5659535988/"
|
|
80 |
|
81 |
== Changelog ==
|
82 |
|
|
|
|
|
|
|
|
|
83 |
= 1.5.2 =
|
84 |
* Plugin now loads later to allow for custom taxonomies
|
85 |
|
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¤cy_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.3.1
|
7 |
Stable tag: trunk
|
20 |
<h4>Features</h4>
|
21 |
* Edit term descriptions with WordPress's built-in WYSIWYG editor
|
22 |
* Works with custom taxonomies (and custom post types, introduced in WP 3.0)
|
23 |
+
* Now supports user biography fields!
|
24 |
|
25 |
== Installation ==
|
26 |
|
37 |
|
38 |
== Upgrade Notice ==
|
39 |
|
40 |
+
= 1.6 =
|
41 |
+
* Added support for rich text editing user biography fields!
|
42 |
+
* Made load a little later for support of more taxonomies
|
43 |
+
|
44 |
= 1.5.2 =
|
45 |
* Plugin now loads later to allow for custom taxonomies
|
46 |
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
+
= 1.6 =
|
89 |
+
* Added support for rich text editing user biography fields!
|
90 |
+
* Made load a little later for support of more taxonomies
|
91 |
+
|
92 |
= 1.5.2 =
|
93 |
* Plugin now loads later to allow for custom taxonomies
|
94 |
|
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.
|
8 |
Author URI: http://www.katzwebservices.com
|
9 |
*/
|
10 |
|
@@ -26,7 +26,7 @@ Author URI: http://www.katzwebservices.com
|
|
26 |
*/
|
27 |
|
28 |
|
29 |
-
add_action('init', 'kws_rich_text_tags');
|
30 |
function kws_rich_text_tags() {
|
31 |
|
32 |
global $wpdb, $user, $current_user, $pagenow, $wp_version;
|
@@ -36,10 +36,14 @@ function kws_rich_text_tags() {
|
|
36 |
// ADD EVENTS
|
37 |
if(
|
38 |
$pagenow == 'edit-tags.php' ||
|
39 |
-
$pagenow == 'categories.php'
|
|
|
|
|
40 |
) {
|
41 |
if(!user_can_richedit()) { return; }
|
42 |
-
|
|
|
|
|
43 |
$taxonomies = get_taxonomies();
|
44 |
|
45 |
foreach($taxonomies as $tax) {
|
@@ -47,11 +51,13 @@ function kws_rich_text_tags() {
|
|
47 |
add_action($tax.'_add_form_fields', 'kws_add_form');
|
48 |
}
|
49 |
|
50 |
-
wp_enqueue_script('kws_rte', plugins_url('kws_rt_taxonomy.js', __FILE__), array('jquery'));
|
51 |
-
|
52 |
if($pagenow == 'edit-tags.php' && isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit' && empty($_REQUEST['taxonomy'])) {
|
53 |
add_action('edit_term','kws_rt_taxonomy_save');
|
54 |
-
}
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
|
57 |
// Enable shortcodes in category, taxonomy, tag descriptions
|
@@ -71,28 +77,47 @@ function kws_rt_taxonomy_save() {
|
|
71 |
}
|
72 |
}
|
73 |
|
74 |
-
|
|
|
75 |
global $pagenow;
|
76 |
|
77 |
-
$content = is_object($taxonomy) && isset($taxonomy->description) ? $taxonomy->description : '';
|
78 |
-
$content = html_entity_decode($content);
|
79 |
-
|
80 |
-
if( $pagenow == 'edit-tags.php') {
|
81 |
-
$editor_id = 'tag_description';
|
82 |
-
$editor_selector = 'description';
|
83 |
-
} else {
|
84 |
-
$editor_id = $editor_selector = 'category_description';
|
85 |
-
}
|
86 |
-
|
87 |
$css = '
|
88 |
-
<style type="text/css">
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
</style>';
|
94 |
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
<tr class="form-field">
|
97 |
<th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
|
98 |
<td><?php wp_editor($content, $editor_id,
|
@@ -103,9 +128,8 @@ function kws_add_form($taxonomy = ''){
|
|
103 |
<span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
|
104 |
</tr>
|
105 |
<?php
|
106 |
-
}
|
107 |
-
|
108 |
|
|
|
109 |
|
|
|
110 |
|
111 |
-
?>
|
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.6
|
8 |
Author URI: http://www.katzwebservices.com
|
9 |
*/
|
10 |
|
26 |
*/
|
27 |
|
28 |
|
29 |
+
add_action('init', 'kws_rich_text_tags', 11);
|
30 |
function kws_rich_text_tags() {
|
31 |
|
32 |
global $wpdb, $user, $current_user, $pagenow, $wp_version;
|
36 |
// ADD EVENTS
|
37 |
if(
|
38 |
$pagenow == 'edit-tags.php' ||
|
39 |
+
$pagenow == 'categories.php' ||
|
40 |
+
$pagenow == 'profile.php' ||
|
41 |
+
$pagenow == 'user-edit.php'
|
42 |
) {
|
43 |
if(!user_can_richedit()) { return; }
|
44 |
+
|
45 |
+
wp_enqueue_script('kws_rte', plugins_url('kws_rt_taxonomy.js', __FILE__), array('jquery'));
|
46 |
+
|
47 |
$taxonomies = get_taxonomies();
|
48 |
|
49 |
foreach($taxonomies as $tax) {
|
51 |
add_action($tax.'_add_form_fields', 'kws_add_form');
|
52 |
}
|
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 |
+
add_action('show_user_profile', 'kws_add_form', 1);
|
59 |
+
add_action('edit_user_profile', 'kws_add_form', 1);
|
60 |
+
add_action('edit_user_profile_update', 'kws_rt_taxonomy_save');
|
61 |
}
|
62 |
|
63 |
// Enable shortcodes in category, taxonomy, tag descriptions
|
77 |
}
|
78 |
}
|
79 |
|
80 |
+
|
81 |
+
function kws_add_form($object = ''){
|
82 |
global $pagenow;
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
$css = '
|
85 |
+
<style type="text/css">
|
86 |
+
.wp-editor-container .quicktags-toolbar input.ed_button {
|
87 |
+
width:auto;
|
88 |
+
}
|
89 |
+
.html-active .wp-editor-area { border:0;}
|
90 |
+
</style>';
|
91 |
|
92 |
+
// This is a profile page
|
93 |
+
if(is_a($object, 'WP_User')) {
|
94 |
+
$content = html_entity_decode(get_user_meta($object->ID, 'description', true));
|
95 |
+
$editor_selector = $editor_id = 'description';
|
96 |
+
?>
|
97 |
+
<table class="form-table rich-text-tags">
|
98 |
+
<tr>
|
99 |
+
<th><label for="description"><?php _e('Biographical Info'); ?></label></th>
|
100 |
+
<td><?php wp_editor($content, $editor_id,
|
101 |
+
array(
|
102 |
+
'textarea_name' => $editor_selector,
|
103 |
+
'editor_css' => $css,
|
104 |
+
)); ?><br />
|
105 |
+
<span class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></span></td>
|
106 |
+
</tr>
|
107 |
+
<?php
|
108 |
+
}
|
109 |
+
// This is a taxonomy
|
110 |
+
else {
|
111 |
+
$content = is_object($object) && isset($object->description) ? html_entity_decode($object->description) : '';
|
112 |
+
|
113 |
+
if( in_array($pagenow, array('edit-tags.php')) ) {
|
114 |
+
$editor_id = 'tag_description';
|
115 |
+
$editor_selector = 'description';
|
116 |
+
} else {
|
117 |
+
$editor_id = $editor_selector = 'category_description';
|
118 |
+
}
|
119 |
+
|
120 |
+
?>
|
121 |
<tr class="form-field">
|
122 |
<th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
|
123 |
<td><?php wp_editor($content, $editor_id,
|
128 |
<span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
|
129 |
</tr>
|
130 |
<?php
|
|
|
|
|
131 |
|
132 |
+
}
|
133 |
|
134 |
+
}
|
135 |
|
|