Title: [Plugin: Social Connect] Fix for sc_add_javascripts()
Last modified: August 20, 2016

---

# [Plugin: Social Connect] Fix for sc_add_javascripts()

 *  [lukewarmmizer](https://wordpress.org/support/users/lukewarmmizer/)
 * (@lukewarmmizer)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-social-connect-fix-for-sc_add_javascripts/)
 * Hi,
 * I noticed that some of my translation code was being duplicated 5 times and finally
   traced it to the Social Connect plugin. Further investigation showed that it 
   was the sc_add_javascripts() function in the media.php file and was related to
   the way that the javascript files were being included. I am by no means an expert
   on this plugin, but I added the following to my functions.php file and all is
   still working as expected, without the duplicated javascript:
 *     ```
       // Override Social Connect plugin to prevent duplicate javascript output
       remove_action( 'login_head', 'sc_add_javascripts' );
       remove_action( 'wp_head', 'sc_add_javascripts' );
       add_action( 'login_head', 'my_sc_add_javascripts' );
       add_action( 'wp_head', 'my_sc_add_javascripts' );
       function my_sc_add_javascripts(){
       	wp_enqueue_script("social_connect", SOCIAL_CONNECT_PLUGIN_URL . "/media/js/connect.js", array("jquery", "jquery-ui-core", "jquery-ui-dialog"));
       }
       ```
   
 * The original code uses the wp_print_scripts function, which is calling the print_scripts
   filter, which in turn results in the duplicated translation javascript. Unless
   I am totally off, this might be a good update for the base plugin.
 * Thanks for all the work you’ve put into this!
 * [http://wordpress.org/extend/plugins/social-connect/](http://wordpress.org/extend/plugins/social-connect/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [lukewarmmizer](https://wordpress.org/support/users/lukewarmmizer/)
 * (@lukewarmmizer)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-social-connect-fix-for-sc_add_javascripts/#post-2869202)
 * D’oh! Just went to submit a fix on the Github repository and see that you’ve 
   already done it – [https://github.com/thenbrent/social-connect/commit/9509de2b0728c94e06de9542cc9f857071c8bed1](https://github.com/thenbrent/social-connect/commit/9509de2b0728c94e06de9542cc9f857071c8bed1)
 * Any idea when these changes will be rolled out?

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Social Connect] Fix for sc_add_javascripts()’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/social-connect.svg)
 * [Social Connect](https://wordpress.org/plugins/social-connect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/social-connect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/social-connect/)
 * [Active Topics](https://wordpress.org/support/plugin/social-connect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/social-connect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/social-connect/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [lukewarmmizer](https://wordpress.org/support/users/lukewarmmizer/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-social-connect-fix-for-sc_add_javascripts/#post-2869202)
 * Status: not resolved