Opened 12 months ago

Last modified 6 days ago

#20901 new enhancement

Taxonomy descriptions should be TinyMCE editable

Reported by: joostdevalk Owned by:
Priority: normal Milestone: Awaiting Review
Component: Administration Version:
Severity: normal Keywords: dev-feedback
Cc: sirzooro, michael@…, ian@…, jeremy@…

Description

Right now taxonomy descriptions are filtered heavily for HTML and are output as a simple textarea, making it impossible to make those into "nice" tinymce editors without a kind of hackish plugin.

I'd be in favor of making taxonomy descriptions tinymce by default.

Change History (12)

Sounds like a plugin territory. They are not shown by many (most?) themes. I had an old plugin to enable TinyMCE there, didn't prove popular.

Sounds like a chicken or egg problem to me :) until they get more prominence in core, not a whole lot of themes will start using them properly... But as said, right now you need to hack your way around to make it TinyMCE, i'd be happy with even a simpler way of doing it.

comment:3 follow-up: ↓ 5   azaozz11 months ago

Agreed, there's no reason to strip HTML there, they should follow the same filtering rules like posts and pages. Then adding an editor would be quite easy.

  • Cc sirzooro added

comment:5 in reply to: ↑ 3   ericlewis11 months ago

Replying to azaozz:

Agreed, there's no reason to strip HTML there, they should follow the same filtering rules like posts and pages. Then adding an editor would be quite easy.

So a step in the right direction here would be to remove the 'wp_filter_kses' filter for term_description, which would eliminate the current HTML filtering. Not finding one in default-filters.php, but does the_content use a similar filter for a more broad allowed HTML tag set?

  • Cc michael@… added

I think this is a great idea! One thing to add would be to enable shortcodes to be parsed in the term description as well. This could be really helpful when a user creates a category for a location and would like to embed a map.

  • Cc ian@… added

I just messed around with this - it's pretty easy on edit-tag-form.php, since the page reloads with the form submit:

<?php 
wp_editor( $tag->description, 'description', array( 'textarea_rows' => 5 ) ) 
?>

It's harder on edit-tags.php because you have to mess with wplink.js to get the form submission to work, and you have to alter the editor so it fits in the space. You also have to decide whether to parse the data that is displayed in the list table in the description column:

<?php 
wp_editor( '', 'tag-description', array( 
	'textarea_rows' => 5, 
	'quicktags'	=> array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' ),	
	'tinymce' => array(
		'theme_advanced_buttons1' => 'bold,italic,strikethrough,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink, |, spellchecker,wp_adv',
		'theme_advanced_buttons2' => 'formatselect,underline,justifyfull,forecolor,|,charmap,|,outdent,indent,|,undo,redo,wp_help',
		'theme_advanced_buttons3' => '',
		'theme_advanced_buttons4' => '',
	) 
) ) ?>

wplink.js is in a weird limbo state - see #21152

  • Cc jeremy@… added

#22848 was marked as a duplicate.

  • Component changed from General to Administration

Previously: #6793

Note: See TracTickets for help on using tickets.