WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#47617 closed defect (bug) (invalid)

Using wp_editor in {$taxonomy}_edit_form_fields not working

Reported by: flyonthenet.com Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: TinyMCE Keywords:
Focuses: Cc:
PR Number:

Description

Consider this simple piece of code:

function test_form_fields( ) {
	echo '<tr class="form-field term-description-wrap"><th scope="row">Snippet</th><td>';
	wp_editor( 'TEST', 'snippet', array(
		'textarea_name' => 'snippet'
	));
	echo '</td></tr>';
}
add_action( 'category_add_form_fields', 'test_form_fields');
add_action( 'category_edit_form_fields', 'test_form_fields');

It's expected to show a functional TinyMCE editor, but something weird is rendered, seems mixed up with description field.

https://www.bagaria.it/wp-content/uploads/2019/06/wp_editor.png

  • Content not displayed (empty tinyMCE)
  • No toolbar rendered
  • No textarea tag with id "snippet" in source code
  • Media / Visual / Text are applied to description field

Attachments (1)

wp_editor.PNG (24.8 KB) - added by flyonthenet.com 5 months ago.

Download all attachments as: .zip

Change History (4)

#1 follow-up: @flyonthenet.com
5 months ago

  • Resolution set to invalid
  • Status changed from new to closed

#2 in reply to: ↑ 1 @flyonthenet.com
5 months ago

Replying to flyonthenet.com:

term-description-wrap class is causing the problem

#3 @SergeyBiryukov
5 months ago

  • Component changed from General to TinyMCE
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.