WordPress.org

Ready to get started?Download WordPress

Forums

Social Sharing Toolkit
WordPress admin script enqueue (2 posts)

  1. constantin.boiangiu
    Member
    Posted 2 years ago #

    In some cases the plugin causes js errors due to tabs and sortables in wp admin. To avoid that the admin.js script should be loaded by providing the dependencies instead of wp_enqueue_script.
    This piece of code (on line 135 in social_sharing_toolkit.php) solves the problem:

    wp_enqueue_script('mr_social_sharing-admin', plugins_url('/admin.js', __FILE__), array('jquery-ui-tabs', 'jquery-ui-sortable'));

    A much better approach would be to load the scripts only on the admin page of the plugin. Currently they get loaded all over wp administration area. Other than that, nice job, congrats.

    http://wordpress.org/extend/plugins/social-sharing-toolkit/

  2. funkyphenix
    Member
    Posted 2 years ago #

    Oh Great Lord. ^_^p

    Thank you for this tips !

    I spent quite a few days (and nights) looking for a solution to the Js error caused by this plugin.
    It worked for me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic