Add support to front end editors like the Asgaros forums one
-
Hi Cople,
Thanks for this useful plugin!
But it currently works well only with the build-in classic WordPress editor.
If we uses other classic editors, front end editors from plugins, your CSS is not loaded and as a result 1/ your button is not displayed and 2/ if we click on the blank space, the 22 smilies are displayed oversized.So could you add the support to front end editors like the Asgaros forums one?
The fix was found by Yworld here…
https://www.asgaros.de/support/topic/tinymce-smiley-button-asgaros-forum/#postid-2753You just need to update the tinymce-smiley-button.php file to set to load the CSS for “wp_enqueue_scripts” and not only for “admin_enqueue_scripts”.
Basically you can just replace…
function mce_smiley_css() { wp_enqueue_style('smiley', plugins_url('/plugin.css', __FILE__)); } add_action( 'admin_enqueue_scripts', 'mce_smiley_css' );
…by…
function mce_smiley_css_admin() { wp_enqueue_style('smiley', plugins_url('/plugin.css', __FILE__)); } add_action( 'admin_enqueue_scripts', 'mce_smiley_css_admin' ); function mce_smiley_css_front() { wp_enqueue_style('smiley', plugins_url('/plugin.css', __FILE__)); } add_action( 'wp_enqueue_scripts', 'mce_smiley_css_front' );
Note the 2 “_admin” added to your original code to make clear about the role of the 2 pieces of code and the code added specifically for the front end editors.
Your support would be greatly appreciated by users of many plugins! ??
P.S.: if you update the plugin, maybe you can credit Yworld in the Changelog. He should appreciate ??
- The topic ‘Add support to front end editors like the Asgaros forums one’ is closed to new replies.