Пример #1
0
function sfc_like_button_automatic($content)
{
    global $post;
    $post_types = apply_filters('sfc_like_post_types', get_post_types(array('public' => true)));
    if (!in_array($post->post_type, $post_types)) {
        return $content;
    }
    // exclude bbPress post types
    if (function_exists('bbp_is_custom_post_type') && bbp_is_custom_post_type()) {
        return $content;
    }
    $options = get_option('sfc_options');
    $args = array('layout' => $options['like_layout'], 'action' => $options['like_action'], 'send' => $options['like_send']);
    $button = get_sfc_like_button($args);
    switch ($options['like_position']) {
        case "before":
            $content = $button . $content;
            break;
        case "after":
            $content = $content . $button;
            break;
        case "both":
            $content = $button . $content . $button;
            break;
        case "manual":
        default:
            break;
    }
    return $content;
}
Пример #2
0
function sfc_like_button_automatic($content)
{
    $options = get_option('sfc_options');
    $args = array('layout' => $options['like_layout'], 'action' => $options['like_action']);
    $button = get_sfc_like_button($args);
    switch ($options['like_position']) {
        case "before":
            $content = $button . $content;
            break;
        case "after":
            $content = $content . $button;
            break;
        case "both":
            $content = $button . $content . $button;
            break;
        case "manual":
        default:
            break;
    }
    return $content;
}