return; } // Return if disabled if (!wpex_global_obj('has_social_share') && 'post' !== get_post_type()) { return; } // Get sharing sites $sites = wpex_social_share_sites(); // Return if there aren't any sites enabled if (empty($sites)) { return; } // Get current post id $post_id = wpex_global_obj('post_id'); // Get sharing settings $position = wpex_social_share_position(); $style = wpex_social_share_style(); // Get heading $heading = wpex_social_share_heading(); // Get and encode permalink $permalink = get_permalink($post_id); $url = urlencode($permalink); $url = apply_filters('wpex_social_share_url', $url); // Get and encode title $args = array('before' => false, 'after' => false, 'echo' => false, 'post' => $post_id); $title = urlencode(esc_attr(the_title_attribute($args))); // Get and encode summary $args = array('length' => '40', 'echo' => false, 'ignore_more_tag' => true); $summary = urlencode(wpex_get_excerpt($args)); // Get image $img = wp_get_attachment_url(get_post_thumbnail_id($post_id));
/** * Checks if the social sharing style supports a custom heading * * @since 1.0.0 */ function wpex_social_sharing_supports_heading() { $bool = false; if (wpex_social_share_sites() && 'horizontal' == wpex_social_share_position()) { $bool = true; } $bool = apply_filters('wpex_social_sharing_supports_heading', $bool); return $bool; }