* @version 3.0.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Disabled if post is password protected if (post_password_required()) { 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);
/** * 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; }