WordPress.org

Make WordPress Core

Opened 23 months ago

Last modified 3 months ago

#20901 new enhancement

Taxonomy descriptions should be TinyMCE editable

Reported by: joostdevalk Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: dev-feedback
Focuses: administration Cc:

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 (13)

comment:1 azaozz23 months ago

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.

comment:2 joostdevalk23 months ago

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: azaozz23 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.

comment:4 sirzooro22 months ago

  • Cc sirzooro added

comment:5 in reply to: ↑ 3 ericlewis22 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?

comment:6 mfields20 months ago

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

comment:7 iandstewart20 months ago

  • Cc ian@… added

comment:8 wonderboymusic20 months ago

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

comment:9 hd-J19 months ago

  • Cc jeremy@… added

comment:10 SergeyBiryukov17 months ago

#22848 was marked as a duplicate.

comment:11 SergeyBiryukov17 months ago

  • Component changed from General to Administration

comment:13 nacin3 months ago

  • Component changed from Administration to Taxonomy
  • Focuses administration added
Note: See TracTickets for help on using tickets.