WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#28259 closed enhancement (duplicate)

Add filter to enable users to alter the WP Editor settings

Reported by: Kau-Boy Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

A user wanted to have the WYSIWYG (HTML) view available in the media editing. But as far as I can see, it is currently impossible to do so without hacking the core and setting the flag "tinymce" to true.

Adding a filter would enable users (or plugin developers) to alter the settings passed to the parse_settings() function.

I have a patch attached to this ticket and already wrote a little plugin to test it:

<?php
/*
Plugin Name: WP Editor Settings
Description: Change the settings for the WP Editor
*/

add_action( 'wp_editor_settings', 'activate_tinymce_on_media', 10, 2 );

function activate_tinymce_on_media( $settings, $editor_id ) {
	if ( 'attachment_content' == $editor_id ) {
		$settings['tinymce'] = true;
	}
	
	return $settings;
}

P.S. If you decide to add such a fitler, feel free to use another name for it.

Attachments (1)

28259.diff (695 bytes) - added by Kau-Boy 3 years ago.

Download all attachments as: .zip

Change History (5)

@Kau-Boy
3 years ago

#1 @zodiac1978
3 years ago

  • Keywords has-patch dev-feedback added

#2 follow-up: @helen
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #24472.

#3 in reply to: ↑ 2 ; follow-up: @ocean90
3 years ago

  • Keywords dev-feedback removed
  • Type changed from feature request to enhancement

Replying to helen:

Duplicate of #24472.

This is more an exact duplicate of #19103. I also prefer a global filter like this which seems to be the latest idea in #24472.

#4 in reply to: ↑ 3 @Kau-Boy
3 years ago

Replying to ocean90:

You are right, looks pretty much the same. I haven't found this closed ticket before creating my one. Sorry.

But now matter how you solve it, some filter should be added somewhere.

Note: See TracTickets for help on using tickets.