Embedalbum Pro Shortcodes

Below, you’ll find a detailed guide on how to add the Embedalbum Pro 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 Embedalbum Pro Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Embedalbum Pro Plugin and the shortcodes it provides:

Plugin Icon
EmbedSocial – Social Media Feeds, Reviews and Galleries

"EmbedSocial – Social Media Feeds, Reviews, and Galleries is a versatile WordPress plugin that seamlessly integrates your social media feeds, customer reviews, and photo galleries into your website. Boost engagement with a sleek, user-friendly design."

★★★★★ (4) Active Installs: 5000+ Tested with: 6.0.6 PHP Version: false
Included Shortcodes:
  • [embedsocial_schema]
  • [embedsocial_album]
  • [embedsocial_gallery]
  • [embedsocial_instagram]
  • [embedsocial_twitter]
  • [embedsocial_google_album]
  • [embedsocial_feed]
  • [embedsocial_reviews]
  • [embedsocial_google_reviews]
  • [embedsocial_custom_reviews]
  • [embedsocial_stories]
  • [embedsocial_stories_popup]
  • [embedsocial_story_gallery]
  • [embedsocial_hashtag]
  • [embedsocial_badge]
  • [embedsocial_badge_custom]

Embedalbum Pro [embedsocial_schema] Shortcode

The EmbedAlbum Pro plugin shortcode, ’embedsocial_schema’, fetches and displays reviews from EmbedSocial. The shortcode accepts parameters like ‘id’, ‘type’, ‘name’, etc. It retrieves review data from the EmbedSocial API, caches it for faster load times, and outputs it on your site.

Shortcode: [embedsocial_schema]

Parameters

Here is a list of all possible embedsocial_schema shortcode parameters and attributes:

  • id – Unique identifier for the schema data
  • type – Defines the type of the schema
  • name – Sets the name for the schema
  • address – Specifies the address in the schema
  • telephone – Sets the telephone number in the schema
  • price_range – Defines the price range in the schema
  • url – Specifies the URL in the schema
  • logo_url – Sets the logo URL in the schema
  • summary – Controls the visibility of the summary
  • summary_url – Specifies the URL for the summary
  • opening_hours – Sets the opening hours in the schema
  • image – Defines the image URL in the schema
  • latitude – Specifies the latitude for the schema
  • longitude – Sets the longitude for the schema
  • address_locality – Defines the locality in the schema address
  • address_region – Specifies the region in the schema address
  • postal_code – Sets the postal code in the schema address
  • street_address – Defines the street address in the schema

Examples and Usage

Basic example – Embeds a social schema with the specified ID.

[embedsocial_schema id="12345" /]

Advanced examples

Embeds a social schema with the specified ID and type. The type parameter can be used to specify the type of schema to display.

[embedsocial_schema id="12345" type="restaurant" /]

Displays a social schema with additional details such as name, address, and telephone. This can be useful for businesses that want to display more information about their location.

[embedsocial_schema id="12345" name="My Business" address="123 Main St" telephone="555-555-5555" /]

Embeds a social schema with a specific price range, URL, and logo URL. This can be useful for businesses that want to display more specific information about their products or services.

[embedsocial_schema id="12345" price_range="$$$" url="https://mybusiness.com" logo_url="https://mybusiness.com/logo.png" /]

Displays a social schema with opening hours and an image. This can be useful for businesses that want to display their operating hours and a representative image.

[embedsocial_schema id="12345" opening_hours="Mon-Fri 9am-5pm" image="https://mybusiness.com/image.png" /]

Embeds a social schema with detailed address information. This can be useful for businesses that want to display a complete address with locality, region, postal code, and street address.

[embedsocial_schema id="12345" address_locality="New York" address_region="NY" postal_code="10001" street_address="123 Main St" /]

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_schema', array($plugin, 'embedsocial_schema_shortcode'));

Shortcode PHP function:

function embedsocial_schema_shortcode( $atts ) 
    {
        $params = (shortcode_atts(array(
            'id' => '',
            'type' => '',
            'name' => '',
            'address' => '',
            'telephone' => '',
            'price_range' => '',
            'url' => '',
            'logo_url' => '',
            'summary' => 'hide',
            'summary_url' => '',
            'opening_hours' => '',
            'image' => '',
            'latitude' => '',
            'longitude' => '',
            'address_locality' => '',
            'address_region' => '',
            'postal_code' => '',
            'street_address' => ''
        ), $atts));

        $out = "";
        if ($params['id']) {
            $params['id'] = sanitize_key($params['id']);
            $key = $params['id'] . '_schema';
            $group = 'embedsocial';
            $data = wp_cache_get($key, $group);
            if ($data) {
                return $this->schemaUpdate($data, $params);
            }

            $response = wp_remote_get('https://embedsocial.com/api/reviews_schema_data/' . $params['id']);
            if (wp_remote_retrieve_response_code($response) >= 400) {
                return "";
            }
            $data = wp_remote_retrieve_body($response);
            if ($data) {
                $data = json_decode($data, true);
                if (isset($data['success']) && $data['success']) {

                    $schema = $data['schema'];
                    wp_cache_set($key, $schema, $group, 7200);
                    return $this->schemaUpdate($schema, $params);
                }
            }
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_album] Shortcode

The EmbedAlbum-Pro shortcode allows you to display a specific social media album on your WordPress site. This shortcode uses the ’embedsocial_fb_album_shortcode’ function, which is triggered in the footer of your WordPress site. It requires an ‘id’ attribute, which corresponds to the specific album you want to display. The album’s ‘id’ is sanitized for security purposes and then embedded within a ‘div’ element with the class ’embedsocial-album’.

Shortcode: [embedsocial_album]

Parameters

Here is a list of all possible embedsocial_album shortcode parameters and attributes:

  • id – Unique identifier for the specific album to embed

Examples and Usage

Basic example – A shortcode to embed a social album using its unique ID.

[embedsocial_album id="12345" /]

Advanced examples

Using the shortcode to embed a social album using its unique ID, with additional parameters. The album will load based on the ID provided.

[embedsocial_album id="12345" param1="value1" param2="value2" /]

Please note that the ‘param1’ and ‘param2′ are placeholders for actual parameters that might be supported by the ’embedsocial_album’ shortcode. Replace them with the actual parameter names and their corresponding values.

In the given PHP code, only the ‘id’ parameter is used. If more parameters are supported, they should be added in the array passed to the shortcode_atts function in the embedsocial_fb_album_shortcode function.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_album', array($plugin, 'embedsocial_fb_album_shortcode'));

Shortcode PHP function:

function embedsocial_fb_album_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this,"hook_embed_album_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-album' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_gallery] Shortcode

The ’embedsocial_gallery’ shortcode is used to embed a social media gallery in a WordPress website. It’s part of the EmbedAlbum Pro plugin. This shortcode calls the ’embedsocial_fb_gallery_shortcode’ function, which hooks the ’embed_gallery_js’ script to the WordPress footer. It accepts an ‘id’ attribute that corresponds to the specific gallery. The gallery is then displayed within a div element with the class ’embedsocial-gallery’.

Shortcode: [embedsocial_gallery]

Parameters

Here is a list of all possible embedsocial_gallery shortcode parameters and attributes:

  • id – Unique identifier for the specific gallery

Examples and Usage

Basic example – Showcases the simplest way to use the shortcode, by just specifying the ID of the gallery you want to embed.

[embedsocial_gallery id=123 /]

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_gallery', array($plugin, 'embedsocial_fb_gallery_shortcode'));

Shortcode PHP function:

function embedsocial_fb_gallery_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_gallery_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-gallery' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_instagram] Shortcode

The ’embedsocial_instagram’ shortcode from the EmbedAlbum-Pro plugin is designed to display an Instagram album on a webpage. The shortcode uses an ‘id’ attribute to identify the specific Instagram album to display. It embeds Instagram JS in the footer and generates a div container with a ‘data-ref’ attribute. This attribute holds the sanitized ‘id’, linking to the desired Instagram album.

Shortcode: [embedsocial_instagram]

Parameters

Here is a list of all possible embedsocial_instagram shortcode parameters and attributes:

  • id – Unique identifier for the specific Instagram album

Examples and Usage

Basic example – A simple way to use the ’embedsocial_instagram’ shortcode is by specifying the album id in the shortcode. This will embed the Instagram album with the corresponding id into your WordPress post or page.

[embedsocial_instagram id='your_album_id' /]

Advanced examples – Though the given shortcode does not have multiple parameters, you can still use it in various ways by combining it with other shortcodes or HTML. For instance, you can wrap it within a div with a specific class for styling, or use it alongside other shortcodes to create a rich content layout.

[embedsocial_instagram id='your_album_id' /]

Another example could be using it within a WordPress column block to display the Instagram album alongside other content.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_instagram', array($plugin, 'embedsocial_instagram_album_shortcode'));

Shortcode PHP function:

function embedsocial_instagram_album_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_instagram_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-instagram' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_twitter] Shortcode

The EmbedAlbum Pro shortcode, ’embedsocial_twitter’, is used to display a Twitter album on a WordPress site. This shortcode fetches the album ID from the Twitter API and embeds it into the site. It sanitizes the input to ensure security and adds it to the site’s footer using ‘wp_footer’ action. The album is displayed within a ‘div’ element with the class ’embedsocial-twitter’.

Shortcode: [embedsocial_twitter]

Parameters

Here is a list of all possible embedsocial_twitter shortcode parameters and attributes:

  • id – The unique identifier for the specific Twitter album to embed

Examples and Usage

Basic example – Embeds a specific Twitter album into your WordPress page or post using the album’s unique ID.

[embedsocial_twitter id='12345' /]

For more advanced usage, you may want to use additional parameters/attributes to further customize the display of your Twitter album.

Advanced example – In this example, we’re not only embedding a Twitter album using its unique ID, but we’re also assigning it a custom CSS class for further styling and customization.

[embedsocial_twitter id='12345' class='my-custom-class' /]

Please note that the actual effect of the ‘class’ attribute will depend on the CSS rules you have defined in your theme’s stylesheet or custom CSS.

Keep in mind that the ‘id’ attribute is mandatory for the shortcode to work, as it specifies which Twitter album to embed. Other attributes like ‘class’ are optional and serve to provide additional customization options.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_twitter', array($plugin, 'embedsocial_twitter_album_shortcode'));

Shortcode PHP function:

function embedsocial_twitter_album_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_twitter_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-twitter' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_google_album] Shortcode

The EmbedAlbum Pro shortcode, ’embedsocial_google_album’, dynamically embeds Google photo albums into a WordPress site. It triggers a function that adds a JavaScript hook to the footer, then generates a div with a unique ID. This div serves as a container for the embedded album. The ID is sanitized for security.

Shortcode: [embedsocial_google_album]

Parameters

Here is a list of all possible embedsocial_google_album shortcode parameters and attributes:

  • id – A unique identifier for the Google album to be embedded.

Examples and Usage

Basic example – A simple usage of the shortcode to embed a Google album using its ID.

[embedsocial_google_album id="your_google_album_id" /]

Advanced examples:

Embedding a Google album using its ID, with additional parameters for customization. This example shows how to use the shortcode with multiple parameters. It’s important to note that the parameters should be separated by spaces.

[embedsocial_google_album id="your_google_album_id" param2="value2" param3="value3" /]

Another advanced example could be using the shortcode in a PHP file. This is particularly useful when you want to include the shortcode in a template file or within a loop in your theme. You can do this by using the do_shortcode function provided by WordPress.

<?php echo do_shortcode('[embedsocial_google_album id="your_google_album_id"]'); ?>

Remember to replace “your_google_album_id”, “value2”, and “value3” with your actual values when using these examples.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_google_album', array($plugin, 'embedsocial_google_album_shortcode'));

Shortcode PHP function:

function embedsocial_google_album_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_google_album_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-google-place' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_feed] Shortcode

The EmbedAlbum Pro shortcode is a powerful tool that allows users to embed social media feeds directly into their WordPress site. This shortcode uses the ’embedsocial_feed’ function to add a social feed to the footer of the website. It requires an ‘id’ attribute, which is the unique identifier for the social feed. If the ‘id’ is provided, the function creates a div element with the class ’embedsocial-socialfeed’ and the data reference set to the provided ‘id’. This div is where the social feed will be displayed.

Shortcode: [embedsocial_feed]

Parameters

Here is a list of all possible embedsocial_feed shortcode parameters and attributes:

  • id – The unique identifier for the specific social feed to embed.

Examples and Usage

Basic example – Embeds a social feed into your WordPress page using the ’embedsocial_feed’ shortcode. The ‘id’ attribute is used to specify the unique identifier of the social feed you want to embed.

[embedsocial_feed id=123 /]

For more advanced usage, you can manipulate the shortcode to suit your specific needs. Below are some examples:

Advanced examples

Using the shortcode to display a social feed by referencing the ID. If the feed with the specified ID is not found, no feed will be displayed.

[embedsocial_feed id=456 /]

Using the shortcode without an ID. In this case, the shortcode will not display any feed.

[embedsocial_feed /]

Please note that the ‘id’ attribute is required for the shortcode to function properly. Without it, the shortcode will not be able to fetch and display the desired social feed.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_feed', array($plugin, 'embedsocial_feed_shortcode'));

Shortcode PHP function:

function embedsocial_feed_shortcode( $atts ) 
    {
		add_action('wp_footer', array($this, "hook_embed_socialfeed_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-socialfeed' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_reviews] Shortcode

The EmbedAlbum-Pro plugin shortcode, ’embedsocial_reviews’, allows users to embed social reviews into their WordPress site. It utilizes parameters like ‘id’, ‘tags’, and ‘lazyload’ to customize the reviews display. The ‘id’ parameter identifies the specific review album, ‘tags’ allows filtering reviews, and ‘lazyload’ controls loading speed.

Shortcode: [embedsocial_reviews]

Parameters

Here is a list of all possible embedsocial_reviews shortcode parameters and attributes:

  • id – The unique identifier for the review album
  • tags – Tags to filter the reviews by
  • lazyload – Defines if the album should load immediately or when in view

Examples and Usage

Basic example – Embeds an album by referencing its ID.

[embedsocial_reviews id=123 /]

Advanced examples

Embeds an album using its ID and tags. The album will load with the specified tags.

[embedsocial_reviews id=123 tags="travel, summer" /]

Embeds an album using its ID, tags, and lazyload attribute. The album will load with the specified tags and the lazyload attribute will determine whether the album loads as the page loads or when the album becomes visible in the viewer’s browser.

[embedsocial_reviews id=123 tags="travel, summer" lazyload="no" /]

Embeds an album using only its ID and the lazyload attribute. The album will load when it becomes visible in the viewer’s browser.

[embedsocial_reviews id=123 lazyload="yes" /]

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_reviews', array($plugin, 'embedsocial_reviews_album_shortcode'));

Shortcode PHP function:

function embedsocial_reviews_album_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_reviews_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => '',
            'tags' => '',
            'lazyload' => ''
        ), $atts));

        $out = "<div class='embedsocial-reviews' ";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= " data-ref='{$shortcodeId['id']}' ";

            if ($shortcodeId['tags']) {
	        $shortcodeId['tags'] = sanitize_text_field($shortcodeId['tags']); 
                $out .= " data-tags='{$shortcodeId['tags']}' ";
            }
            if ($shortcodeId['lazyload'] && $shortcodeId['lazyload'] == 'no') {
                $out .= " data-lazyload='no' ";
            } else {
                $out .= " data-lazyload='yes' ";
            }
            $out .= "></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_google_reviews] Shortcode

The EmbedAlbum Pro shortcode, ’embedsocial_google_reviews’, dynamically adds Google reviews to your site. It’s triggered by the ‘wp_footer’ action, and uses a unique ID for each review album.

Shortcode: [embedsocial_google_reviews]

Parameters

Here is a list of all possible embedsocial_google_reviews shortcode parameters and attributes:

  • id – A unique identifier for the Google reviews album

Examples and Usage

Basic example – Embeds Google Reviews album using shortcode id.

[embedsocial_google_reviews id=1 /]

Advanced examples

Embeds Google Reviews album with a specific id. If the album with the given id is not found, it will not display anything.

[embedsocial_google_reviews id=2 /]

Embeds Google Reviews album with a different id. If the album with the given id is not found, it will not display anything.

[embedsocial_google_reviews id=3 /]

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_google_reviews', array($plugin, 'embedsocial_google_reviews_album_shortcode'));

Shortcode PHP function:

function embedsocial_google_reviews_album_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_google_reviews_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-google-reviews' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_custom_reviews] Shortcode

The EmbedAlbum Pro shortcode, ’embedsocial_custom_reviews’, generates custom review albums. It hooks into the ‘wp_footer’ and uses the ‘id’ attribute to display the reviews.

Shortcode: [embedsocial_custom_reviews]

Parameters

Here is a list of all possible embedsocial_custom_reviews shortcode parameters and attributes:

  • id – Unique identifier for the specific review album

Examples and Usage

Basic example – Embeds a custom review album by referencing its unique ID.

[embedsocial_custom_reviews id="12345" /]

Advanced examples

Embedding multiple custom review albums by referencing their unique IDs. This is useful when you want to display reviews from different sources on the same page.

[embedsocial_custom_reviews id="12345" /]
[embedsocial_custom_reviews id="67890" /]

Embedding a custom review album by referencing its ID and adding custom CSS classes for styling. This allows you to customize the appearance of the review album to match your site’s theme.

[embedsocial_custom_reviews id="12345" class="my-custom-class another-custom-class" /]

Please note that the ‘id’ parameter is mandatory for the shortcode to work. The ‘class’ parameter is optional and can be used to add custom CSS classes to the review album.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_custom_reviews', array($plugin, 'embedsocial_custom_reviews_album_shortcode'));

Shortcode PHP function:

function embedsocial_custom_reviews_album_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_custom_reviews_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-custom-reviews' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_stories] Shortcode

The EmbedAlbum-Pro shortcode, ’embedsocial_stories’, is designed to embed social stories on your WordPress site. It allows you to add a specific social story by specifying its ‘id’ in the shortcode. The function ’embedsocial_stories_shortcode’ is triggered when the shortcode is used, attaching the ‘hook_embed_story_js’ function to the ‘wp_footer’ action. The ‘id’ attribute is sanitized to prevent security issues. Then, a div element with the class ’embedsocial-stories’ and data reference as the ‘id’ is generated. This div is where the social story will be displayed.

Shortcode: [embedsocial_stories]

Parameters

Here is a list of all possible embedsocial_stories shortcode parameters and attributes:

  • id – A unique identifier for the specific social story to be embedded.

Examples and Usage

Basic example – The following shortcode enables you to embed social stories on your website by specifying the ID associated with the story.

[embedsocial_stories id=123 /]

Advanced examples

Here, we are using the shortcode to display social stories by referencing the ID. If the ID is not found or is incorrect, the shortcode will not return anything.

[embedsocial_stories id=456 /]

In the next example, we are showcasing a scenario where no ID is provided. In this case, the shortcode will not display any stories because the ID is a mandatory attribute.

[embedsocial_stories /]

Please note that the ID used in the shortcode should be the unique identifier of the social story you want to display. You can find this ID in the EmbedAlbum Pro plugin settings.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_stories', array($plugin, 'embedsocial_stories_shortcode'));

Shortcode PHP function:

function embedsocial_stories_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_story_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-stories' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_stories_popup] Shortcode

The ’embedsocial_stories_popup’ shortcode is part of the EmbedAlbum Pro plugin. It adds a pop-up for social media stories on your website. It hooks into the ‘wp_footer’ action, allowing the stories to load at the end of the page. The ‘id’ attribute is used to reference the specific story to be displayed. The shortcode then returns a div element with the class ’embedsocial-stories-popup’ and the data reference of the story.

Shortcode: [embedsocial_stories_popup]

Parameters

Here is a list of all possible embedsocial_stories_popup shortcode parameters and attributes:

  • id – Unique identifier for the specific social story to display.

Examples and Usage

Basic example – A simple implementation of the ’embedsocial_stories_popup’ shortcode. In this case, we are using the ‘id’ attribute to specify the ID of the story we want to display.

[embedsocial_stories_popup id=1 /]

Advanced examples

Using the shortcode to display multiple stories by referencing their IDs. This is an advanced usage where we are specifying multiple IDs separated by commas. The stories will load in the order of the IDs.

[embedsocial_stories_popup id="1,2,3" /]

Displaying a story by referencing the ID and adding custom CSS classes. This is another advanced usage where we are not only specifying the ID but also adding custom CSS classes to the popup container for further customization.

[embedsocial_stories_popup id=1 class="custom-class1 custom-class2" /]

Please note that in the above examples, you need to replace ‘1’, ‘1,2,3’, and ‘custom-class1 custom-class2’ with your actual story ID(s) and CSS class names.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_stories_popup', array($plugin, 'embedsocial_stories_popup_shortcode'));

Shortcode PHP function:

function embedsocial_stories_popup_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_story_popup_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-stories-popup' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_story_gallery] Shortcode

The EmbedAlbum Pro shortcode ’embedsocial_story_gallery’ displays a social media story gallery on your website. It pulls stories based on the specified ‘id’ attribute. The PHP function ’embedsocial_story_gallery_shortcode’ hooks into the WP footer, sanitizes the input, and generates a div with the story gallery.

Shortcode: [embedsocial_story_gallery]

Parameters

Here is a list of all possible embedsocial_story_gallery shortcode parameters and attributes:

  • id – Specific identifier for the story gallery to be displayed.

Examples and Usage

Basic example – Embed a social story gallery by referencing its ID.

[embedsocial_story_gallery id=123 /]

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_story_gallery', array($plugin, 'embedsocial_story_gallery_shortcode'));

Shortcode PHP function:

function embedsocial_story_gallery_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_story_gallery_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-story-gallery' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_hashtag] Shortcode

The EmbedAlbum Pro shortcode ’embedsocial_hashtag’ is used to embed social media hashtags into a webpage. It triggers the ‘hook_embed_hashtag_js’ function on the page footer. When implemented, it checks for a valid ID. If found, it sanitizes the input and creates a div element with the class ’embedsocial-hashtag’. The data reference attribute is set to the provided ID.

Shortcode: [embedsocial_hashtag]

Parameters

Here is a list of all possible embedsocial_hashtag shortcode parameters and attributes:

  • id – Unique identifier for the specific hashtag album

Examples and Usage

Basic example – This example showcases a simple usage of the ’embedsocial_hashtag’ shortcode. The shortcode is used to embed a social media hashtag feed on your website by referencing the unique ID of the feed.

[embedsocial_hashtag id=123 /]

Advanced examples

Here, the shortcode is used to display a social media hashtag feed by referencing the unique ID. If the feed with the provided ID is not found, the shortcode will not return anything, leaving the page unaffected.

[embedsocial_hashtag id=456 /]

In this advanced example, the ’embedsocial_hashtag’ shortcode is used without an ID. This will not render any feed on the page but will add a specific action to the footer of the website. This action hooks the ’embed_hashtag_js’ function to the ‘wp_footer’ action, which can be used to add custom JavaScript related to the EmbedSocial plugin to the footer of your website.

[embedsocial_hashtag /]

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_hashtag', array($plugin, 'embedsocial_hashtag_shortcode'));

Shortcode PHP function:

function embedsocial_hashtag_shortcode( $atts ) 
    {
        add_action('wp_footer', array($this, "hook_embed_hashtag_js"));

        $shortcodeId = (shortcode_atts(array(
            'id' => ''
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out .= "<div class='embedsocial-hashtag' data-ref='{$shortcodeId['id']}'></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_badge] Shortcode

The ’embedsocial_badge’ shortcode from EmbedAlbum Pro plugin dynamically generates a social review badge. It uses a unique ID and style to fetch the badge image from the EmbedSocial API.

Shortcode: [embedsocial_badge]

Parameters

Here is a list of all possible embedsocial_badge shortcode parameters and attributes:

  • id – The specific identifier for the review badge
  • style – Determines the visual theme of the review badge

Examples and Usage

Basic example – Display an EmbedSocial badge using its unique ID

[embedsocial_badge id="1234" /]

In this basic example, the ’embedsocial_badge’ shortcode is used to display a specific EmbedSocial badge on your WordPress site. The ‘id’ attribute is used to specify the unique ID of the badge you want to display.

Advanced examples

Display an EmbedSocial badge using its unique ID and specify a custom style

[embedsocial_badge id="1234" style="badge-2-g" /]

In this advanced example, the ’embedsocial_badge’ shortcode is used to display a specific EmbedSocial badge with a custom style. The ‘id’ attribute is used to specify the unique ID of the badge you want to display, and the ‘style’ attribute is used to specify the custom style you want to apply to the badge.

Display an EmbedSocial badge using its unique ID, but if not found, try to display a badge with a different ID

[embedsocial_badge id="1234" /]
[embedsocial_badge id="5678" /]

In this advanced example, two ’embedsocial_badge’ shortcodes are used. The first shortcode tries to display a badge with the ID ‘1234’. If this badge is not found, the second shortcode tries to display a badge with the ID ‘5678’.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_badge', array($plugin, 'embedsocial_badge_shortcode'));

Shortcode PHP function:

function embedsocial_badge_shortcode( $atts ) 
    {
        $shortcodeId = (shortcode_atts(array(
            'id' => '',
            'style' => 'badge-1-g'
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out = "<div class='reviews-badges'><img src='https://embedsocial.com/api/reviews_badges/{$shortcodeId['style']}/{$shortcodeId['id']}'/></div>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Embedalbum Pro [embedsocial_badge_custom] Shortcode

The ’embedsocial_badge_custom’ shortcode from EmbedAlbum-Pro plugin generates a custom social badge. It uses an iframe to display the badge from the ’embedsocial’ website.

Shortcode: [embedsocial_badge_custom]

Parameters

Here is a list of all possible embedsocial_badge_custom shortcode parameters and attributes:

  • id – Unique ID used to fetch and display specific social reviews

Examples and Usage

Basic example – A simple usage of the ’embedsocial_badge_custom’ shortcode to display a custom badge by referencing its ID.

[embedsocial_badge_custom id=123 /]

Advanced examples

Using the ’embedsocial_badge_custom’ shortcode with an invalid or non-existing ID. In this case, the shortcode will not output anything.

[embedsocial_badge_custom id=99999 /]

Using the ’embedsocial_badge_custom’ shortcode without an ID. Again, the shortcode will not output anything in this scenario.

[embedsocial_badge_custom /]

Note: The ’embedsocial_badge_custom’ shortcode only accepts one parameter, ‘id’, which is used to specify the ID of the custom badge to be displayed. If the ‘id’ parameter is not provided or if the provided ID does not correspond to an existing custom badge, the shortcode will not output anything.

PHP Function Code

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

Shortcode line:

add_shortcode('embedsocial_badge_custom', array($plugin, 'embedsocial_badge_custom_shortcode'));

Shortcode PHP function:

function embedsocial_badge_custom_shortcode( $atts ) 
    {
        $shortcodeId = (shortcode_atts(array(
            'id' => '',
        ), $atts));

        $out = "";
        if ($shortcodeId['id']) {
            $shortcodeId['id'] = $this->sanitizeInput($shortcodeId['id']); 
            $out = "<iframe src='https://embedsocial.com/api/reviews_source_badges_custom/{$shortcodeId['id']}' scrolling='no' style='width: 300px; height: 55px; border: 0px; overflow: hidden;' /></iframe>";
        }
        return $out;
    }

Code file location:

embedalbum-pro/embedalbum-pro/embedalbum_pro.php

Conclusion

Now that you’ve learned how to embed the Embedalbum Pro 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 *