9

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.

1

3 Answers 3

11
+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

8
  • 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. :) Aug 26, 2011 at 17:41
  • +1 for simplicity. Adding to my snippets and will try soon. Thanks
    – Michal Mau
    Aug 26, 2011 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. Aug 26, 2011 at 17:53
  • just a reminder to @hsatterwhite to award bounty
    – marfarma
    Aug 29, 2011 at 16:49
  • 1
    Its a bit outdated. This helped me: wordpress.stackexchange.com/questions/190510/… Jul 28, 2016 at 9:23
2

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

1
  • 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! Aug 26, 2011 at 17:47
0

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).

1
  • 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. Apr 28, 2011 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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