Super Socializer Shortcodes

Below, you’ll find a detailed guide on how to add the Super Socializer Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Super Socializer Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Super Socializer Plugin and the shortcodes it provides:

★★★★☆ (662) Active Installs: 40000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [TheChamp-Sharing]
  • [TheChamp-Counter]
  • [TheChamp-Login]
  • [TheChamp-FB-Comments]
  • [TheChamp-Social-Linking]

Super Socializer [TheChamp-Sharing] Shortcode

The Super Socializer shortcode allows for social sharing on your WordPress site. It uses various parameters to customize the sharing experience, including style, type, alignment, and share count. This shortcode creates a sharing container on your webpage. It checks if sharing is enabled, generates a target URL, and decides on a sharing type (horizontal or vertical). It also handles URL shortening if enabled. The shortcode ends by preparing the sharing HTML and returning it, allowing social sharing buttons to be displayed on your site. It dynamically adjusts to different devices and screen sizes.

Shortcode: [TheChamp-Sharing]

Parameters

Here is a list of all possible TheChamp-Sharing shortcode parameters and attributes:

  • style – Specifies the CSS styling of the sharing buttons
  • type – Determines if the sharing bar is horizontal or vertical
  • left – The distance in pixels from the left side of the page
  • right – The distance in pixels from the right side of the page
  • top – The distance in pixels from the top of the page
  • url – The URL to be shared; if not provided, the current page’s URL is used
  • count – Shows the number of shares if set to 1, hides if set to 0
  • align – Determines the alignment of the sharing bar; options are left or right
  • title – The title text to display above the sharing buttons
  • total_shares – Shows the total number of shares if set to ‘ON’, hides if set to ‘OFF’

Examples and Usage

Basic example – A simple usage of the shortcode to enable social sharing on your website.

[TheChamp-Sharing /]

Advanced examples

Enabling social sharing with a horizontal layout and a custom title.

[TheChamp-Sharing type="horizontal" title="Share this post"/]

Displaying the social sharing icons on the left side of the page, with a vertical alignment, and a specified distance from the top.

[TheChamp-Sharing type="vertical" align="left" top="50"/]

Enabling social sharing with a custom URL and disabling the display of the total share count.

[TheChamp-Sharing url="http://example.com" total_shares="OFF"/]

Using the shortcode to display social sharing icons with a custom style.

[TheChamp-Sharing style="background-color:blue; color:white;"/]

PHP Function Code

In case you have difficulties debugging what causing issues with [TheChamp-Sharing] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('TheChamp-Sharing', 'the_champ_sharing_shortcode');

Shortcode PHP function:

function the_champ_sharing_shortcode($params){
	// notify if sharing is disabled
	if(the_champ_social_sharing_enabled()){
		global $theChampSharingOptions;
		extract(shortcode_atts(array(
			'style' => '',
			'type' => 'horizontal',
			'left' => '0',
			'right' => '0',
			'top' => '100',
			'url' => '',
			'count' => 0,
			'align' => 'left',
			'title' => '',
			'total_shares' => 'OFF'
		), $params));
		if(($type == 'horizontal' && !the_champ_horizontal_sharing_enabled()) || ($type == 'vertical' && (the_champ_is_amp_page() || !the_champ_vertical_sharing_enabled()))){
			return;
		}
		global $post;

		if(!is_object($post)){
	        return;
		}

		$customUrl = apply_filters('heateor_ss_custom_share_url', '', $post);
		if($customUrl){
			$targetUrl = $customUrl;
			$postId = 0;
		}elseif($url){
			$targetUrl = esc_url($url);
			$postId = 0;
		}elseif(is_front_page()){
			$targetUrl = esc_url_raw(home_url());
			$postId = 0;
		}elseif(!is_singular() && $type == 'vertical'){
			$targetUrl = esc_url_raw(the_champ_get_http().$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);
			$postId = 0;
		}elseif(isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']){
			$targetUrl = esc_url_raw(the_champ_get_http().$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);
			$postId = $post->ID;
		}elseif(get_permalink($post->ID)){
			$targetUrl = get_permalink($post->ID);
			$postId = $post->ID;
		}else{
			$targetUrl = esc_url_raw(the_champ_get_http().$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);
			$postId = 0;
		}
		$shareCountUrl = $targetUrl;
		if($url == '' && is_singular()){
			$shareCountUrl = get_permalink($post->ID);
		}
		$customPostUrl = heateor_ss_apply_target_share_url_filter($targetUrl, $type, false);
		if($customPostUrl != $targetUrl){
			$targetUrl = $customPostUrl;
			$shareCountUrl = $targetUrl;
		}
		// if bit.ly url shortener enabled, generate bit.ly short url
		$shortUrl = '';
		if(isset($theChampSharingOptions['use_shortlinks']) && function_exists('wp_get_shortlink')){
			$shortUrl = wp_get_shortlink();
			// if bit.ly integration enabled, generate bit.ly short url
		}elseif(isset($theChampSharingOptions['bitly_enable']) && isset($theChampSharingOptions['bitly_access_token']) && $theChampSharingOptions['bitly_access_token'] != ''){
			$shortUrl = the_champ_generate_sharing_bitly_url($targetUrl, $postId);
		}
		$alignmentOffset = 0;
		if($left){
			$alignmentOffset = $left;
		}elseif($right){
			$alignmentOffset = $right;
		}
		$shareCountTransientId = heateor_ss_get_share_count_transient_id($targetUrl);
		$cachedShareCount = heateor_ss_get_cached_share_count($shareCountTransientId);
		$html = '<div class="the_champ_sharing_container the_champ_'.esc_attr($type).'_sharing' . ($type == 'vertical' && isset($theChampSharingOptions['hide_mobile_sharing']) ? ' the_champ_hide_sharing' : '') . ($type == 'vertical' && isset($theChampSharingOptions['bottom_mobile_sharing']) ? ' the_champ_bottom_sharing' : '') . '" ' . (the_champ_is_amp_page() ? '' : 'data-heateor-ss-offset="' . esc_attr($alignmentOffset) . '" ') . (the_champ_is_amp_page() ? '' : 'data-super-socializer-href="' . (isset($shareCountUrl) && $shareCountUrl ? $shareCountUrl : $targetUrl) . '"') . ($cachedShareCount === false || the_champ_is_amp_page() ? "" : 'data-super-socializer-no-counts="1" ');
		$verticalOffsets = '';
		if($type == 'vertical'){
			$verticalOffsets = esc_attr($align) . ': '.esc_attr($$align).'px; top: '.esc_attr($top).'px;width:' . ((isset($theChampSharingOptions['vertical_sharing_size']) ? $theChampSharingOptions['vertical_sharing_size'] : '35') + 4) . "px;";
		}
		// style 
		if($style != "" || $verticalOffsets != ''){
			$html .= 'style="';
			if(strpos($style, 'background') === false){ $html .= '-webkit-box-shadow:none;box-shadow:none;'; }
			$html .= $verticalOffsets;
			$html .= esc_attr($style);
			$html .= '"';
		}
		$html .= '>';
		if($type == 'horizontal' && $title != ''){
			$html .= '<div style="font-weight:bold" class="the_champ_sharing_title">' . ucfirst(esc_html($title)) . '</div>';
		}
		$html .= the_champ_prepare_sharing_html($shortUrl == '' ? $targetUrl : $shortUrl, $shareCountUrl, $type, $count, $total_shares == 'ON' ? 1 : 0, $shareCountTransientId);
		$html .= '</div>';
		if(($count || $total_shares == 'ON') && $cachedShareCount === false){
			$html .= '<script>theChampLoadEvent(function(){theChampCallAjax(function(){theChampGetSharingCounts();});});</script>';
		}
		return $html;
	}
}

Code file location:

super-socializer/super-socializer/inc/shortcode.php

Super Socializer [TheChamp-Counter] Shortcode

The Super Socializer plugin shortcode, ‘TheChamp-Counter’, is used to display a social media counter on your website. It allows customization of the counter’s style, type, alignment, and URL. The PHP function ‘the_champ_counter_shortcode’ extracts parameters from the shortcode, checks if the counter is enabled, and determines the URL. It then generates the HTML for the counter, including optional title and style adjustments. The function also supports shortlinks and bit.ly integration. If these options are enabled, it generates the appropriate URL for the counter.

Shortcode: [TheChamp-Counter]

Parameters

Here is a list of all possible TheChamp-Counter shortcode parameters and attributes:

  • style – Specifies the CSS styling for the counter.
  • type – Determines the layout of the counter, either ‘horizontal’ or ‘vertical’.
  • left – Sets the left offset of the counter in pixels.
  • right – Sets the right offset of the counter in pixels.
  • top – Sets the top offset of the counter in pixels.
  • url – Specifies the URL for the counter to target.
  • align – Sets the alignment of the counter, either ‘left’ or ‘right’.
  • title – Defines the title displayed above the counter.

Examples and Usage

Basic Example – Display the social counter in its default settings.

[TheChamp-Counter /]

Advanced Examples

Displaying the social counter with a custom style, alignment, and title. The style parameter is used to add custom CSS, the align parameter is used to specify the alignment of the counter, and the title parameter is used to add a custom title to the counter.

[TheChamp-Counter style="background-color: #f0f0f0; color: #000;" align="right" title="My Custom Title" /]

Displaying the social counter for a specific URL. The url parameter is used to specify the URL for which the social counter is displayed.

[TheChamp-Counter url="http://mywebsite.com/my-page" /]

Displaying the social counter with custom positioning. The left, right, and top parameters are used to specify the position of the social counter.

[TheChamp-Counter left="10" right="20" top="30" /]

Displaying the social counter in a vertical layout. The type parameter is used to specify the layout of the social counter.

[TheChamp-Counter type="vertical" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [TheChamp-Counter] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('TheChamp-Counter', 'the_champ_counter_shortcode');

Shortcode PHP function:

function the_champ_counter_shortcode($params){
	// notify if counter is disabled
	if(the_champ_social_counter_enabled()){
		extract(shortcode_atts(array(
			'style' => '',
			'type' => 'horizontal',
			'left' => '0',
			'right' => '0',
			'top' => '100',
			'url' => '',
			'align' => 'left',
			'title' => ''
		), $params));
		if(($type == 'horizontal' && !the_champ_horizontal_counter_enabled()) || ($type == 'vertical' && !the_champ_vertical_counter_enabled())){
			return;
		}
		global $post;
		if(!is_object($post)){
	        return;
		}
		
		$customUrl = apply_filters('heateor_ss_custom_share_url', '', $post);
		if($customUrl){
			$targetUrl = $customUrl;
			$postId = 0;
		}elseif($url){
			$targetUrl = esc_url($url);
			$postId = 0;
		}elseif(is_front_page()){
			$targetUrl = esc_url_raw(home_url());
			$postId = 0;
		}elseif(!is_singular() && $type == 'vertical'){
			$targetUrl = esc_url_raw(the_champ_get_http().$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
			$postId = 0;
		}elseif(isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']){
			$targetUrl = esc_url_raw(the_champ_get_http().$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
			$postId = $post->ID;
		}elseif(get_permalink($post->ID)){
			$targetUrl = get_permalink($post->ID);
			$postId = $post->ID;
		}else{
			$targetUrl = esc_url_raw(the_champ_get_http().$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
			$postId = 0;
		}
		$targetUrl = heateor_ss_apply_target_like_button_url_filter($targetUrl, $type, false);
		$alignmentOffset = 0;
		if($left){
			$alignmentOffset = $left;
		}elseif($right){
			$alignmentOffset = $right;
		}
		global $theChampCounterOptions;
		$html = '<div class="the_champ_counter_container the_champ_'. esc_attr($type) .'_counter' . ($type == 'vertical' && isset($theChampCounterOptions['hide_mobile_likeb']) ? ' the_champ_hide_sharing' : '') . '" ' . (the_champ_is_amp_page() ? '' : 'data-heateor-ss-offset="' . esc_attr($alignmentOffset) . '" ');
		$verticalOffsets = '';
		if($type == 'vertical'){
			$verticalOffsets = esc_attr($align) . ': '.esc_attr($$align).'px; top: '.esc_attr($top).'px;width:117px;';
		}
		// style 
		if($style != "" || $verticalOffsets != ''){
			$html .= 'style="';
			if(strpos($style, 'background') === false){ $html .= '-webkit-box-shadow:none;box-shadow:none;'; }
			$html .= $verticalOffsets;
			$html .= esc_attr($style);
			$html .= '"';
		}
		$html .= '>';
		if($type == 'horizontal' && $title != ''){
			$html .= '<div style="font-weight:bold" class="the_champ_counter_title">' . ucfirst(esc_html($title)) . '</div>';
		}
		$counterUrl = $targetUrl;
		if(isset($theChampCounterOptions['use_shortlinks']) && function_exists('wp_get_shortlink')){
			$counterUrl = wp_get_shortlink();
			// if bit.ly integration enabled, generate bit.ly short url
		}elseif(isset($theChampCounterOptions['bitly_enable']) && isset($theChampCounterOptions['bitly_access_token']) && $theChampCounterOptions['bitly_access_token'] != ''){
			$shortUrl = the_champ_generate_counter_bitly_url($targetUrl, $postId);
			if($shortUrl){
				$counterUrl = $shortUrl;
			}
		}
		$html .= the_champ_prepare_counter_html($targetUrl, $type, $counterUrl);
		$html .= '</div>';
		return $html;
	}
}

Code file location:

super-socializer/super-socializer/inc/shortcode.php

Super Socializer [TheChamp-Login] Shortcode

The Super-Socializer shortcode is used to display a social login button. It checks if a user is logged in, and if so, it shows their avatar and username with a logout link. If a user is not logged in, it displays the social login button. The style, title, and redirect URL can be customized. The shortcode also includes options for various social media platforms for user authentication.

Shortcode: [TheChamp-Login]

Parameters

Here is a list of all possible TheChamp-Login shortcode parameters and attributes:

  • style – Controls the CSS style of the login button
  • title – Sets the text title above the login button
  • redirect_url – Defines the URL to redirect users after login
  • show_username – If set to ‘ON’, it displays the logged-in user’s username

Examples and Usage

Basic example – Show a simple social login form with the default settings.

[TheChamp-Login /]

Advanced examples

Display a social login form with a custom title and style.

[TheChamp-Login title="Log In With Your Social Account" style="float:right; margin-top:20px;" /]

Display a social login form with a custom redirect URL after successful login.

[TheChamp-Login redirect_url="https://www.yoursite.com/welcome" /]

Display a social login form with a username shown after successful login.

[TheChamp-Login show_username="ON" /]

Combine multiple parameters/attributes to customize the social login form.

[TheChamp-Login title="Log In With Your Social Account" style="float:right; margin-top:20px;" redirect_url="https://www.yoursite.com/welcome" show_username="ON" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [TheChamp-Login] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('TheChamp-Login', 'the_champ_login_shortcode');

Shortcode PHP function:

function the_champ_login_shortcode($params){
	if(the_champ_social_login_enabled()){
		extract(shortcode_atts(array(
			'style' => '',
			'title' => '',
			'redirect_url' => '',
			'show_username' => 'OFF'
		), $params));
		if($show_username == 'ON' && is_user_logged_in()){
			global $user_ID;
			$userInfo = get_userdata($user_ID);
			$html = "<div style='height:80px;width:180px'><div style='width:63px;float:left;'>";
			$html .= @get_avatar($user_ID, 60, $default, $alt);
			$html .= "</div><div style='float:left; margin-left:10px'>";
			$html .= str_replace('-', ' ', $userInfo->user_login);
			//do_action('the_champ_login_widget_hook', $userInfo->user_login);
			$html .= '<br/><a href="' . wp_logout_url(esc_url(home_url())) . '">' .__('Log Out', 'super-socializer') . '</a></div></div>';
		}else{
			$html = '<div ';
			// style 
			if($style != ""){
				$style = esc_attr($style);
				if(strpos($style, 'float') === false){
					$style = 'float: left;' . $style;
				}
				$html .= 'style="'.$style.'"';
			}
			$html .= '>';
			if( !is_user_logged_in() && $title != '' ) {
				$html .= '<div style="font-weight:bold" class="the_champ_social_login_title">' . ucfirst(esc_html($title)) . '</div>';
			}
			$html .= the_champ_login_button(true);
			$html .= '</div><div style="clear:both"></div>';
			if($redirect_url){
				$html .= '<script type="text/javascript">theChampCustomRedirect = "'. urlencode(esc_url($redirect_url)) .'";var theChampSteamAuthUrl = "",theChampTwitterAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Twitter&super_socializer_redirect_to=" + theChampCustomRedirect, theChampLineAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Line&super_socializer_redirect_to=" + theChampCustomRedirect, theChampLiveAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Live&super_socializer_redirect_to=" + theChampCustomRedirect, theChampFacebookAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Facebook&super_socializer_redirect_to=" + theChampCustomRedirect, theChampYahooAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Yahoo&super_socializer_redirect_to=" + theChampCustomRedirect, theChampGoogleAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Google&super_socializer_redirect_to=" + theChampCustomRedirect, theChampYoutubeAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Youtube&super_socializer_redirect_to=" + theChampCustomRedirect, theChampVkontakteAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Vkontakte&super_socializer_redirect_to=" + theChampCustomRedirect, theChampLinkedinAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Linkedin&super_socializer_redirect_to=" + theChampCustomRedirect, theChampInstagramAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Instagram&super_socializer_redirect_to=" + theChampCustomRedirect, theChampWordpressAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Wordpress&super_socializer_redirect_to=" + theChampCustomRedirect, theChampDribbbleAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Dribbble&super_socializer_redirect_to=" + theChampCustomRedirect, theChampGithubAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Github&super_socializer_redirect_to=" + theChampCustomRedirect, theChampSpotifyAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Spotify&super_socializer_redirect_to=" + theChampCustomRedirect, theChampKakaoAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Kakao&super_socializer_redirect_to=" + theChampCustomRedirect, theChampTwitchAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Twitch&super_socializer_redirect_to=" + theChampCustomRedirect, theChampRedditAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Reddit&super_socializer_redirect_to=" + theChampCustomRedirect, theChampDisqusAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Disqus&super_socializer_redirect_to=" + theChampCustomRedirect, theChampDropboxAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Dropbox&super_socializer_redirect_to=" + theChampCustomRedirect,  theChampFoursquareAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Foursquare&super_socializer_redirect_to=" + theChampCustomRedirect,  theChampStackoverflowAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Stackoverflow&super_socializer_redirect_to=" + theChampCustomRedirect,  theChampDiscordAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Discord&super_socializer_redirect_to=" + theChampCustomRedirect, theChampAmazonAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Amazon&super_socializer_redirect_to=" + theChampCustomRedirect, theChampMailruAuthUrl = theChampSiteUrl + "?SuperSocializerAuth=Mailru&super_socializer_redirect_to=" + theChampCustomRedirect;</script>';
			}
		}
		return $html;
	}
}

Code file location:

super-socializer/super-socializer/inc/shortcode.php

Super Socializer [TheChamp-FB-Comments] Shortcode

The Super Socializer plugin shortcode, ‘TheChamp-FB-Comments’, enables Facebook comments on your WordPress site. It extracts various parameters like style, URL, number of posts, width, language, and title. The shortcode also checks for GDPR compliance with the HEATEOR_FB_COM_NOT_VERSION and HEATEOR_FB_COM_MOD_VERSION functions. It generates an HTML structure for the comments section, with checks for various conditions. The comment section is styled and displayed according to the extracted parameters. It also includes scripts for Facebook SDK initialization and GDPR compliance.

Shortcode: [TheChamp-FB-Comments]

Parameters

Here is a list of all possible TheChamp-FB-Comments shortcode parameters and attributes:

  • style – Defines the CSS styling for the Facebook commenting section
  • url – Specifies the URL for the commenting, default is the current post URL
  • num_posts – Sets the number of comments to display
  • width – Determines the width of the commenting section
  • language – Sets the language for the Facebook SDK, default is the site’s locale
  • title – Defines a title for the commenting section

Examples and Usage

Basic Example – The following shortcode displays the Facebook commenting system on your webpage. It uses the default parameters set in the function.

[TheChamp-FB-Comments]

Advanced Examples

Displaying the Facebook commenting system with a custom style, a specific URL, a set number of posts, a defined width, and a unique title.

[TheChamp-FB-Comments style="background-color:lightgrey;" url="https://yourwebsite.com/your-post/" num_posts="5" width="500" title="Your Custom Title"]

Using the shortcode to display the Facebook commenting system in a specific language. In this example, the language is set to Spanish (es_ES).

[TheChamp-FB-Comments language="es_ES"]

PHP Function Code

In case you have difficulties debugging what causing issues with [TheChamp-FB-Comments] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('TheChamp-FB-Comments', 'the_champ_fb_commenting_shortcode');

Shortcode PHP function:

function the_champ_fb_commenting_shortcode($params){
	extract(shortcode_atts(array(
		'style' => '',
		'url' => get_permalink(),
		'num_posts' => '',
		'width' => '',
		'language' => get_locale(),
		'title' => ''
	), $params));
	$html = '<div style="'. esc_attr($style) .'" id="the_champ_fb_commenting">';
	if( $title != '' ) {
		$html .= '<div style="font-weight:bold">' . ucfirst(esc_html($title)) . '</div>';
	}
	if(defined('HEATEOR_FB_COM_NOT_VERSION') && version_compare('1.1.6', HEATEOR_FB_COM_NOT_VERSION) < 0 && isset($heateor_fcn_options['gdpr_enable'])){
		global $heateor_fcn_options;
		$html .= '<div class="heateor_ss_fb_comments_notifier_optin_container"><label><input type="checkbox" class="heateor_ss_fb_comments_notifier_optin" value="1" />'. str_replace($heateor_fcn_options['ppu_placeholder'], '<a href="'. $heateor_fcn_options['privacy_policy_url'] .'" target="_blank">'. $heateor_fcn_options['ppu_placeholder'] .'</a>', wp_strip_all_tags($heateor_fcn_options['privacy_policy_optin_text'])) .'</label></div>';
	}
	if(defined('HEATEOR_FB_COM_MOD_VERSION') && version_compare('1.2.4', HEATEOR_FB_COM_MOD_VERSION) < 0 && isset($heateor_fcm_options['gdpr_enable'])){
		global $heateor_fcm_options;
		$html .= '<div class="heateor_ss_fb_comments_optin_container"><label><input type="checkbox" class="heateor_ss_fb_comments_optin" value="1" />'. str_replace($heateor_fcm_options['ppu_placeholder'], '<a href="'. $heateor_fcm_options['privacy_policy_url'] .'" target="_blank">'. $heateor_fcm_options['ppu_placeholder'] .'</a>', wp_strip_all_tags($heateor_fcm_options['privacy_policy_optin_text'])) .'</label></div>';
	}
	$html .= '<div class="fb-comments" data-href="' .esc_url_raw($url == '' ? the_champ_get_http().$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] : $url). '"';
    $html .= ' data-numposts="' . intval($num_posts) . '"';
    $html .= ' data-width="' . ($width == '' ? '100%' : esc_attr($width)) . '"';
    $html .= ' ></div></div><script type="text/javascript" src="//connect.facebook.net/' . esc_attr($language) . '/sdk.js
    "></script><script>FB.init({xfbml:1,version: "v14.0"});</script>';
    if(defined('HEATEOR_FB_COM_NOT_VERSION') && version_compare('1.1.5', HEATEOR_FB_COM_NOT_VERSION) < 0){
	    $html .= '<script type="text/javascript">jQuery(window).load(function(){"undefined"!=typeof theChampFacebookCommentsNotifierOptinText&&(null!=heateorFcnGetCookie("heateorFcnOptin")&&jQuery("input.heateor_ss_fb_comments_notifier_optin").prop("checked",!0),jQuery("input.heateor_ss_fb_comments_notifier_optin").click(function(){if(jQuery(this).is(":checked")){if(heateorFcnOptin=1,null==heateorFcnGetCookie("heateorFcnOptin")){}}else heateorFcnOptin=0,document.cookie="heateorFcnOptin=; expires=Fri, 02 Jan 1970 00:00:00 UTC; path=/"}));});</script>';
	}
	if(defined('HEATEOR_FB_COM_MOD_VERSION') && version_compare('1.2.3', HEATEOR_FB_COM_MOD_VERSION) < 0){
		 $html .= '<script type="text/javascript">jQuery(window).load(function(){"undefined"!=typeof theChampFacebookCommentsOptinText&&(null!=heateorFcmGetCookie("heateorFcmOptin")&&jQuery("input.heateor_ss_fb_comments_optin").prop("checked",!0),jQuery("input.heateor_ss_fb_comments_optin").click(function(){if(jQuery(this).is(":checked")){if(heateorFcmOptin=1,null==heateorFcmGetCookie("heateorFcmOptin")){}}else heateorFcmOptin=0,document.cookie="heateorFcmOptin=; expires=Fri, 02 Jan 1970 00:00:00 UTC; path=/"}));});</script>';
	}
	return $html;
}

Code file location:

super-socializer/super-socializer/inc/shortcode.php

Super Socializer [TheChamp-Social-Linking] Shortcode

The Super Socializer shortcode enables social linking on your website. It checks if social login is enabled and if so, it extracts the style and title parameters. If a title is provided, it’s displayed in bold. The shortcode then adds social account linking, replacing ‘&’ with ‘&’. If social login isn’t enabled, it prompts the admin to enable it.

Shortcode: [TheChamp-Social-Linking]

Examples and Usage

Basic example – The shortcode ‘TheChamp-Social-Linking’ is used to display social linking buttons, allowing users to link their social media accounts to their user profile on your website.

[TheChamp-Social-Linking /]

Advanced examples

Adding a title to the social linking buttons. By using the ‘title’ parameter, you can add a custom title above the social linking buttons on your website.

[TheChamp-Social-Linking title="Link your Social Media Accounts" /]

Styling the social linking buttons. The ‘style’ parameter allows you to add custom CSS styles to the social linking buttons.

[TheChamp-Social-Linking style="background-color: #f2f2f2; padding: 20px;" /]

Combining both ‘title’ and ‘style’ parameters. This example shows how you can use both parameters to add a title and custom CSS styles to the social linking buttons.

[TheChamp-Social-Linking title="Link your Social Media Accounts" style="background-color: #f2f2f2; padding: 20px;" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [TheChamp-Social-Linking] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('TheChamp-Social-Linking', 'the_champ_social_linking_shortcode');

Shortcode PHP function:

function the_champ_social_linking_shortcode($params){
	if(the_champ_social_login_enabled()){
		extract(shortcode_atts(array(
			'style' => '',
			'title' => ''
		), $params));
		$html = '<div style="'. esc_attr($style) .'">';
		if( $title != '' ) {
			$html .= '<div style="font-weight:bold">' . ucfirst(esc_html($title)) . '</div>';
		}
		global $heateorSsAllowedTags;
		$html .= str_replace('&amp;', '&', wp_kses(the_champ_account_linking(), $heateorSsAllowedTags));
		$html .= '</div>';
		return $html;
	}
	return '<h3>' . __('Enable Social Login from "Basic Configuration" section at "Super Socializer > Social Login" page in admin panel', 'super-socializer') . '</h3>';
}

Code file location:

super-socializer/super-socializer/inc/shortcode.php

Conclusion

Now that you’ve learned how to embed the Super Socializer Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *