api-routes.php
7 months ago
avatar.php
4 years ago
counter-settings.php
5 years ago
legacy.php
5 years ago
login-settings.php
2 months ago
providers.php
7 months ago
route.php
7 months ago
settings.php
5 years ago
share-settings.php
4 years ago
share.php
3 years ago
share.php
56 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WP_Social\App; |
| 4 | |
| 5 | |
| 6 | class Share { |
| 7 | |
| 8 | public function get_share_primary_content($wanted_providers, $config = []) { |
| 9 | |
| 10 | global $post; |
| 11 | |
| 12 | $postId = isset($post->ID) ? $post->ID : 0; |
| 13 | |
| 14 | $thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($postId), 'full'); |
| 15 | $custom_logo_id = get_theme_mod('custom_logo'); |
| 16 | $image = wp_get_attachment_image_src($custom_logo_id, 'full'); |
| 17 | $customLogo = isset($image[0]) ? $image[0] : ''; |
| 18 | $media = isset($thumbnail_src[0]) ? $thumbnail_src[0] : $customLogo; |
| 19 | $app_id = ''; |
| 20 | $details = ''; |
| 21 | $author = 'xpeedstudio'; |
| 22 | $title = get_the_title($postId); |
| 23 | $source = get_bloginfo(); |
| 24 | |
| 25 | $current_url = (isset($_SERVER['HTTPS']) && sanitize_text_field($_SERVER['HTTPS']) === 'on' ? 'https' : 'http') . '://' . sanitize_text_field($_SERVER['HTTP_HOST']) . sanitize_url($_SERVER['REQUEST_URI']); |
| 26 | |
| 27 | $config['conf_type'] = empty($config['conf_type']) ? 'content_body' : $config['conf_type']; |
| 28 | |
| 29 | $themeFontClass = Share_Settings::instance()->is_theme_font_enabled() ? 'wslu-theme-font-yes' : 'wslu-theme-font-no'; |
| 30 | $customClass = empty($config['class']) ? '' : $config['class']; |
| 31 | |
| 32 | $styles = \WP_Social\Inc\Admin_Settings::share_styles(); |
| 33 | $saved_settings = \WP_Social\App\Share_Settings::instance()->get_style_settings(); |
| 34 | $share_settings = \WP_Social\App\Settings::instance()->get_providers_settings_share(); |
| 35 | $hover_styles = \WP_Social\App\Share_Settings::instance()->get_hover_styles(); |
| 36 | $share_style_key = \WP_Social\App\Share_Settings::instance()->get_selected_style_keys(); |
| 37 | $selected_share_style = \WP_Social\App\Share_Settings::instance()->get_selected_style(); |
| 38 | |
| 39 | $widget_style = \WP_Social\App\Share_Settings::instance()->prepare_widget_class($styles); |
| 40 | $extra_data_cls = \WP_Social\App\Share_Settings::instance()->get_extra_data_class($selected_share_style, $styles); |
| 41 | |
| 42 | $show_count_markup = false; |
| 43 | $total_share_count = 0; |
| 44 | $share_counting = \WP_Social\App\Share_Settings::instance()->get_share_count($post, $wanted_providers); |
| 45 | $core_provider = Providers::get_core_providers_share(); |
| 46 | |
| 47 | |
| 48 | ob_start(); |
| 49 | require(WSLU_LOGIN_PLUGIN . '/template/share/primary_content.php'); |
| 50 | $counter = ob_get_contents(); |
| 51 | ob_end_clean(); |
| 52 | |
| 53 | return $counter; |
| 54 | } |
| 55 | } |
| 56 |