예제 #1
0
 function social_widget()
 {
     $output = '';
     if (function_exists('addthis_display_social_widget')) {
         remove_filter('addthis_above_content', '__return_false', 99);
         add_filter('addthis_below_content', '__return_false', 99);
         $output = addthis_display_social_widget('');
         add_filter('addthis_above_content', '__return_false', 99);
         remove_filter('addthis_below_content', '__return_false', 99);
     }
     return $output;
 }
 function addthis_display_social_widget_excerpt($content)
 {
     // I don't think has_excerpt() is always necessarily true when calling "get_the_excerpt()",
     // but since this function is only as a get_the_excerpt() filter, we should probably
     // not care whether or not an excerpt is there since the caller obviously wants one.
     // needs testing/understanding.
     if (has_excerpt() && _addthis_excerpt_buttons_enabled()) {
         return addthis_display_social_widget($content, true, true);
     } else {
         return $content;
     }
 }
function addthis_display_social_widget_excerpt($content)
{
    if (isset($_GET['preview']) && $_GET['preview'] == 1 && ($options = get_transient('addthis_settings'))) {
        $preview = true;
    } else {
        $options = get_option('addthis_settings');
    }
    // I don't think has_excerpt() is always necessarily true when calling "get_the_excerpt()",
    // but since this function is only as a get_the_excerpt() filter, we should probably
    // not care whether or not an excerpt is there since the caller obviously wants one.
    // needs testing/understanding.
    if (has_excerpt() && $options['addthis_showonexcerpts'] == true) {
        return addthis_display_social_widget($content, true, true);
    } else {
        return $content;
    }
}