Server IP : 213.176.29.180  /  Your IP : 3.138.174.53
Web Server : Apache
System : Linux 213.176.29.180.hostiran.name 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
User : webtaragh ( 1001)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0777) :  /home/webtaragh/public_html/wp-content/plugins/wp-social/inc/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/webtaragh/public_html/wp-content/plugins/wp-social/inc/custom-function.php
<?php

if (!defined('ABSPATH')) die('Forbidden');

/**
 * These are mostly for other plugin, like woocommerce share product widget
 *
 */


if(!function_exists('__wp_social_api_share')) {

	function __wp_social_api_share($providers, $attributes = []) {

		if(empty($providers)) {

			return '';
		}

		if($providers === 'all') {

			$out_provider = \WP_Social\App\Share_Settings::instance()->get_enabled_providers();

		} else {

			$providers = explode(',', $providers);
			$p_conf = \WP_Social\App\Share_Settings::instance()->get_enabled_providers();
			$out_provider = [];

			foreach($providers as $provider) {

				$provider = trim($provider);

				if(isset($p_conf[$provider]) && !empty($p_conf[$provider]['enable'])) {

					$out_provider[$provider] = $p_conf[$provider];
				}
			}
		}

		$share = new \WP_Social\App\Share();

		return $share->get_share_primary_content($out_provider, $attributes);
	}
}


if(!function_exists('__wp_social_share')) {

	function __wp_social_share($provider = 'all', $atts = []) {
		if(class_exists('\WP_Social\Inc\Share')) {
			$return = new \WP_Social\Inc\Share(false);

			return $return->get_share_data($provider, $atts);
		}
	}
}

if(!function_exists('__wp_social_share_pro_check')) {
	function __wp_social_share_pro_check() {
		$option_key     = 'xs_share_providers_data';
		$xsc_options    = get_option($option_key) ? get_option($option_key) : [];
		$share_provider = isset($xsc_options['social']) ? $xsc_options['social'] : [];

		foreach($share_provider AS $kk => $vv):
			if(isset($share_provider[$kk]['enable'])) {
				return true;
			}
		endforeach;

		return false;
	}
}