elementor
3 years ago
admin-create-shortcode.php
7 years ago
admin-create-user.php
5 months ago
admin-custom-function.php
1 year ago
admin-rest-api.php
7 months ago
admin-settings.php
2 years ago
admin-social-button.php
4 months ago
admin-social-enque-script.php
5 years ago
counter-widget.php
3 years ago
counter.php
7 months ago
custom-function.php
4 years ago
login-widget.php
3 years ago
login.php
5 years ago
share-widget.php
3 years ago
share.php
3 months ago
custom-function.php
75 lines
| 1 | <?php |
| 2 | |
| 3 | if (!defined('ABSPATH')) die('Forbidden'); |
| 4 | |
| 5 | /** |
| 6 | * These are mostly for other plugin, like woocommerce share product widget |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | |
| 11 | if(!function_exists('__wp_social_api_share')) { |
| 12 | |
| 13 | function __wp_social_api_share($providers, $attributes = []) { |
| 14 | |
| 15 | if(empty($providers)) { |
| 16 | |
| 17 | return ''; |
| 18 | } |
| 19 | |
| 20 | if($providers === 'all') { |
| 21 | |
| 22 | $out_provider = \WP_Social\App\Share_Settings::instance()->get_enabled_providers(); |
| 23 | |
| 24 | } else { |
| 25 | |
| 26 | $providers = explode(',', $providers); |
| 27 | $p_conf = \WP_Social\App\Share_Settings::instance()->get_enabled_providers(); |
| 28 | $out_provider = []; |
| 29 | |
| 30 | foreach($providers as $provider) { |
| 31 | |
| 32 | $provider = trim($provider); |
| 33 | |
| 34 | if(isset($p_conf[$provider]) && !empty($p_conf[$provider]['enable'])) { |
| 35 | |
| 36 | $out_provider[$provider] = $p_conf[$provider]; |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | $share = new \WP_Social\App\Share(); |
| 42 | |
| 43 | return $share->get_share_primary_content($out_provider, $attributes); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | |
| 48 | if(!function_exists('__wp_social_share')) { |
| 49 | |
| 50 | function __wp_social_share($provider = 'all', $atts = []) { |
| 51 | if(class_exists('\WP_Social\Inc\Share')) { |
| 52 | $return = new \WP_Social\Inc\Share(false); |
| 53 | |
| 54 | return $return->get_share_data($provider, $atts); |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | if(!function_exists('__wp_social_share_pro_check')) { |
| 60 | function __wp_social_share_pro_check() { |
| 61 | $option_key = 'xs_share_providers_data'; |
| 62 | $xsc_options = get_option($option_key) ? get_option($option_key) : []; |
| 63 | $share_provider = isset($xsc_options['social']) ? $xsc_options['social'] : []; |
| 64 | |
| 65 | foreach($share_provider AS $kk => $vv): |
| 66 | if(isset($share_provider[$kk]['enable'])) { |
| 67 | return true; |
| 68 | } |
| 69 | endforeach; |
| 70 | |
| 71 | return false; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 |