[wp-trac] [WordPress Trac] #41500: Custom TinyMCE style formats not working for Text Widget
WordPress Trac
noreply at wordpress.org
Tue Sep 5 20:25:15 UTC 2017
#41500: Custom TinyMCE style formats not working for Text Widget
--------------------------+------------------------------
Reporter: tikitariki | Owner: azaozz
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: Widgets | Version: 4.8
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by sillybean):
As a workaround until the filter works properly, I found that using the
'tinymce-editor-setup' hook to manipulate the style_select array didn't
work, but the 'wp-before-tinymce-init' hook did.
I moved my usual array of format selections into its own function, so I
could use it in both json_encode() and wp_localize_script(). In the JS
file, I assigned that array to the editor's settings.style_formats. I
threw together a quick Gist containing both the relevant PHP and JS:
https://gist.github.com/sillybean/fddc7060efba33162fff7be23edc9f32
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41500#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list