Example #1
0
/**
 * add_filter the_content.
 */
function wp_social_bookmarking_light_the_content($content)
{
    if (is_feed() || is_404() || is_robots() || is_comments_popup() || function_exists('is_ktai') && is_ktai()) {
        return $content;
    }
    $options = wp_social_bookmarking_light_options();
    if ($options['single_page'] && !is_singular()) {
        return $content;
    }
    if (!$options['is_page'] && is_page()) {
        return $content;
    }
    $out = wp_social_bookmarking_light_output($options['services'], get_permalink(), get_the_title());
    if ($out == '') {
        return $content;
    }
    if ($options['position'] == 'top') {
        return "{$out}{$content}";
    } else {
        if ($options['position'] == 'bottom') {
            return "{$content}{$out}";
        } else {
            if ($options['position'] == 'both') {
                return "{$out}{$content}{$out}";
            }
        }
    }
    return $content;
}
Example #2
0
/**
 * Add the Share Buttons to the content.
 * add_filter "the_content"
 *
 * @param string $content
 * @return string
 */
function wp_social_bookmarking_light_the_content($content)
{
    if (!wp_social_bookmarking_light_is_enabled()) {
        return $content;
    }
    $options = wp_social_bookmarking_light_options();
    $out = wp_social_bookmarking_light_output($options['services'], get_permalink(), get_the_title());
    if ($out == '') {
        return $content;
    }
    if ($options['position'] == 'top') {
        return "{$out}{$content}";
    } else {
        if ($options['position'] == 'bottom') {
            return "{$content}{$out}";
        } else {
            if ($options['position'] == 'both') {
                return "{$out}{$content}{$out}";
            }
        }
    }
    return $content;
}