• Resolved ftpwp

    (@ftpwp)


    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-2753

    You 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 ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ftpwp

    (@ftpwp)

    Forgot to mention you @cople so you get notified ??

    Plugin Author Cople

    (@cople)

    @ftpwp Tks for feedback, new version is published.

    Thread Starter ftpwp

    (@ftpwp)

    Tested. It works fine!
    And you’re right, it was useless to add another specific function, just need to run another add_action().

    Thanks!
    I’ll come back to you soon with another suggestion ??

    P.S.: you could just have credited Yworld in the changelog.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add support to front end editors like the Asgaros forums one’ is closed to new replies.