WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#28079 closed defect (bug) (worksforme)

#27601 breaks using wp_editor for saving text fields

Reported by: varun21 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9
Component: Editor Keywords:
Focuses: Cc:

Description

The bugfix #27601 breaks the ability to use wp_editor for saving textarea in theme/plugin settings

name="mychildtheme[textareaname]" doesn't work since id can't have the [brackets] and the textarea name is derived from the id.

Change History (6)

#1 follow-up: @ocean90
4 years ago

  • Keywords close added

You have to define textarea_name in $settings for wp_editor(), see _WP_Editor:: parse_settings().

#2 @SergeyBiryukov
4 years ago

#28813 was marked as a duplicate.

#4 @SergeyBiryukov
4 years ago

#29864 was marked as a duplicate.

#5 in reply to: ↑ 1 ; follow-up: @3cees
4 years ago

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

Replying to ocean90:

You have to define textarea_name in $settings for wp_editor(), see _WP_Editor:: parse_settings().

If I set the textarea_name, it alos does not work. Example:

$editor_id = 'my_options[op_'.$pool["slug"].']';
wp_editor( $content, $editor_id, array( "media_buttons" => FALSE, "textarea_rows" => 10, "teeny" => FALSE, 'textarea_name' => $editor_id ) );

#6 in reply to: ↑ 5 @ocean90
4 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution changed from wontfix to worksforme

Replying to 3cees:

The default value of textarea_name is already the ID of the editor. You have to define an editor ID without brackets and use your ID with brackets for textarea_name.

Note: See TracTickets for help on using tickets.