Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Can you add the visual editor to the description field for custom taxonomies? It would be nice to have this option available when you edit an entry for a taxonomy be it core or custom.

share|improve this question

3 Answers 3

up vote 8 down vote accepted
+50

Just wrote the function. It'll display the tinymce editor in every custom taxonomy description right now. Surely you can edit to show it for only some specific taxonomy.

/**
 * Display advanced TinyMCE editor in taxonomy page
 */
function wpse_7156_enqueue_category() {
    global $pagenow, $current_screen;

    if( $pagenow == 'edit-tags.php' ) {
        require_once(ABSPATH . 'wp-admin/includes/post.php');
        require_once(ABSPATH . 'wp-admin/includes/template.php');

        wp_tiny_mce( false, array( 'editor_selector' => 'description', 'elements' => 'description', 'mode' => 'exact' ));
    } 
}
add_action( 'init', 'wpse_7156_enqueue_category' );

You can provide the first argument in wp_tiny_mce as true if you want a stripped version of tinyMCE

share|improve this answer
    
You nailed it Tareq, thanks! I'm pretty sure they're moving this in to a real API for 3.3, but for now this is a simple solution. I'll award the bounty tomorrow when WPSE lets me. :) –  hsatterwhite Aug 26 '11 at 17:41
    
+1 for simplicity. Adding to my snippets and will try soon. Thanks –  Michal Mau Aug 26 '11 at 17:51
    
@Maugly, agreed. I tried it and you may want to modify it to work with the action=edit, because on the quick edit screen #description is used in the taxonomy table. #tag-description is used for the description text box on the quick edit screen, but your space is limited, because of the two column setup. –  hsatterwhite Aug 26 '11 at 17:53
    
just a reminder to @hsatterwhite to award bounty –  marfarma Aug 29 '11 at 16:49
    
Thanks for the reminder, done and done. Have a good one! –  hsatterwhite Aug 29 '11 at 19:18

Not directly, no.

You could, however, write a custom javascript which applies the appropriate classes to the entry field for the custom taxonomy description.

If what you really want to do, however, is create a "many-to-many" relationship between posts (e.g. a post type of "Tires" and a post type of "Cars"), then WordPress doesn't (currently) have a facility for this. However, the Posts 2 Posts plugin does provide this functionality (and gives you a lot more flexibility to create complex relationships).

share|improve this answer
    
Thanks for the response, but I'm not trying to relate posts to other posts. I'm just trying to add the visual editor to the description field for taxonomies. –  hsatterwhite Apr 28 '11 at 18:50

Have you tried The Rich Text Tags Plugin?

  • It does exactly what you need.
  • Works with custom taxonomies.
  • Works well with images.
  • Includes the new WP internal linking.
  • It is regularly updated.

Screenshot:

Rich Text Tags Screenshot

share|improve this answer
    
I have not heard about this. I appreciate the answer and link with screenshot. In addition to the accepted answer, this is also a great solution. Thank you Maugly! –  hsatterwhite Aug 26 '11 at 17:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.