WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Sharing Script issue (5 posts)

  1. instruite
    Member
    Posted 1 year ago #

    Hello,

    Enabling Disable CSS and JS under sharing options remove the css and js files
    but it still adds script (for each enabled service) in the footer.

    Now since I am using separate minify and defering logics for javascript files those scripts get added before actual jquery script is loaded.

    And also I will like to be able to control that I put those scripts in js file rather than directly on page html

    I tried remove_action but that does not work, I guess since those are directly written on page when sharing_add_footer function is called, remove_action can not unwrite those

    Having ability to control those scripts will be appreciated.

    Thanks
    Hemant

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Since the sharing_add_footer is hooked inside the sharing_display function, that is itself hooked into the_content, you need to remove_action later. This worked for me:

    function jetpackme_rm_share_scripts() {
    	remove_action( 'wp_footer', 'sharing_add_footer' );
    }
    add_action( 'loop_end', 'jetpackme_rm_share_scripts' );
  3. instruite
    Member
    Posted 1 year ago #

    Thanks Jeremy,

    That worked and removed the script part but it also removed the hidden email form for email button.

    Now have to figure out how to add that email part.

    Thanks
    Hemant

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    You can find the email sharing form in modules/sharedaddy/sharing-sources.php:
    http://plugins.trac.wordpress.org/browser/jetpack/trunk/modules/sharedaddy/sharing-sources.php#L272

  5. instruite
    Member
    Posted 1 year ago #

    Thanks for the information, Jeremy.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic