I just upgraded to wordpress 5.3 and now the classic wysiwyg editor in the frontend (I am using it to edit pages on the frontend) does not load in any styles from my style.css or editor-style.css file I have. So all the text in the editor is unstyled. This always worked until I upgraded. I deactivated every other plugin in my site and it still did not work. I am just using my bare bones theme I made, that always worked. Can you replicate this?
Hi, can you tell me more about the classic wysiwyg editor in the front-end? Are you talking about the editor in a Toolset Form that edits a post content, or a custom field WYSIWYG? Or is there another front-end editor you are referring to? It would be helpful if you can show me a full-screen screenshot of the editor so I can see what you're describing.
Also, can you tell me what version of WordPress you were using before the update? Was it < 5?
Thank you!
This is the WYSIWYG field I added and put it into a CRED FORM in the frontend.
I was using 5.2.4 or whatever the last one was before 5.3.
The wysiwyg get editor works fine in the backend but not in the front, with styles.
I'm testing locally in 5.2.4, and trying to enqueue styles for the editors with this code:
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
$parent_style = 'twentynineteen-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
wp_enqueue_style( 'tssupp-wysiwyg-field-style',
get_stylesheet_directory_uri() . '/editor-style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
function my_theme_add_editor_styles() {
add_editor_style( 'editor-style.css' );
}
add_action( 'admin_init', 'my_theme_add_editor_styles' );
Works fine in the backend, but neither style.css nor editor-style.css are applied in the tiny MCE editors on the front-end. In my experience, style.css and editor-style.css are not applied to the tiny MCE editor on the front-end of the site unless you do something like this:
function plugin_mce_css( $mce_css ) {
if ( ! empty( $mce_css ) )
$mce_css .= ',';
$mce_css .= get_stylesheet_directory_uri() . '/editor-style.css';
return $mce_css;
}
add_filter( 'mce_css', 'plugin_mce_css' );
...but there may be multiple ways to do this I'm not aware of. If you have another experience I'll be glad to make a clone of your site, downgrade to 5.2.4, and see if I can replicate the issue. Let me know how you would like to proceed.
Yes I replaced my code with that code and it now works again. Thanks much!