Can you add the visual editor to the description field for custom taxonomies?

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.

Related posts

Leave a Reply

3 comments

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

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