[wp-trac] [WordPress Trac] #41416: styleselect no longer displaying webfont from editor style
WordPress Trac
noreply at wordpress.org
Mon Jul 24 04:38:42 UTC 2017
#41416: styleselect no longer displaying webfont from editor style
--------------------------+-----------------------------
Reporter: smerriman | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: TinyMCE | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Webfonts enqueued as an editor style no longer render in the styleselect
dropdown. They definitely used to; perhaps a change in 4.8.
Steps to replicate:
- add in the styleselect dropdown and a simple style:
{{{
add_filter('mce_buttons_2','my_mce_buttons_2');
function my_mce_buttons_2( $buttons ){
array_splice( $buttons, 0, 0, 'styleselect' );
return $buttons;
}
add_filter('tiny_mce_before_init', 'my_mce_mod');
function my_mce_mod( $init ) {
$style_formats = array (
array( 'title' => 'Test', 'block' => 'p', 'classes'=>'test'),
);
$init['style_formats'] = json_encode( $style_formats );
$init['style_formats_merge'] = false;
return $init;
}
}}}
- enqueue an editor style which uses font-face, and apply the styling to
the test class.
The font appears fine in the editor, but has a big ugly default in the
styleselect dropdown.
I'm hoping there is a solution to this that doesn't include having to
repeat the whole font definition in wp-admin itself.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41416>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list