WordPress.org

Plugin Directory

Changeset 554869


Ignore:
Timestamp:
06/08/12 14:32:06 (23 months ago)
Author:
jorbin
Message:

improve support for no wp_footer

Location:
addthis/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • addthis/trunk/addthis_social_widget.php

    r554554 r554869  
    13491349 
    13501350 
    1351 add_action('wp_footer', 'addthis_output_script'); 
     1351//add_action('wp_footer', 'addthis_output_script'); 
    13521352 
    13531353/** 
  • addthis/trunk/includes/addthis_addjs.php

    r554554 r554869  
    6363            add_action('wp_footer', array($this, 'output_script') ); 
    6464        else 
    65             add_action('the_content', array($this, 'output_script') ); 
     65            add_filter('the_content', array($this, 'output_script_filter') ); 
    6666 
    6767        do_action('addthis_addjs_created'); 
     
    7575            $this->_js_added = true; 
    7676        } 
     77    } 
     78 
     79    function output_script_filter($content){ 
     80        if ($this->_js_added != true && ! is_admin() && ! is_feed() ) 
     81        { 
     82            $this->addWidgetToJs(); 
     83            $content = $content . $this->jsToAdd; 
     84            $this->_js_added = true; 
     85        } 
     86        return $content; 
    7787    } 
    7888 
Note: See TracChangeset for help on using the changeset viewer.