[wp-trac] [WordPress Trac] #28259: Add filter to enable users to alter the WP Editor settings
WordPress Trac
noreply at wordpress.org
Thu May 15 11:14:11 UTC 2014
#28259: Add filter to enable users to alter the WP Editor settings
-----------------------------+-----------------------------
Reporter: Kau-Boy | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: trunk
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28259>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list