Plugin Directory

Changeset 1826201


Ignore:
Timestamp:
02/21/2018 01:22:51 PM (8 years ago)
Author:
embedsocial
Message:

Added Stories Support

Location:
embedalbum-pro/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • embedalbum-pro/trunk/embedalbum_pro.php

    r1741511 r1826201  
    66Author: EmbedSocial
    77Author URI: http://www.embedsocial.com
    8 Version: 1.0.12
     8Version: 1.0.14
    99 */
    1010defined( 'ABSPATH' ) or die;
     
    5353    }
    5454
     55    public function hook_embed_socialfeed_js() {
     56        wp_register_script('EmbedSocialSocialFeedScript', $this->urlEmbedScripts.'sf.js');
     57        wp_enqueue_script('EmbedSocialSocialFeedScript', $this->urlEmbedScripts.'sf.js');
     58    }
     59
    5560    public function hook_embed_reviews_js() {
    5661        wp_register_script('EmbedSocialReviewsScript', $this->urlEmbedScripts.'ri.js');
     
    6873    }
    6974
     75    public function hook_embed_story_js() {
     76        wp_register_script('EmbedSocialStoriesScript', $this->urlEmbedScripts.'st.js');
     77        wp_enqueue_script('EmbedSocialStoriesScript', $this->urlEmbedScripts.'st.js');
     78    }
     79
    7080    public function embedsocial_fb_album_shortcode( $atts )
    7181    {
     
    8696    public function embedsocial_fb_gallery_shortcode( $atts )
    8797    {
    88         add_action('wp_footer', array($this,"hook_embed_gallery_js"));
     98        add_action('wp_footer', array($this, "hook_embed_gallery_js"));
    8999
    90100        $shortcodeId = (shortcode_atts(array(
     
    102112    public function embedsocial_instagram_album_shortcode( $atts )
    103113    {
    104         add_action('wp_footer', array($this,"hook_embed_instagram_js"));
     114        add_action('wp_footer', array($this, "hook_embed_instagram_js"));
    105115
    106116        $shortcodeId = (shortcode_atts(array(
     
    118128    public function embedsocial_twitter_album_shortcode( $atts )
    119129    {
    120         add_action('wp_footer', array($this,"hook_embed_twitter_js"));
     130        add_action('wp_footer', array($this, "hook_embed_twitter_js"));
    121131
    122132        $shortcodeId = (shortcode_atts(array(
     
    134144    public function embedsocial_google_album_shortcode( $atts )
    135145    {
    136         add_action('wp_footer', array($this,"hook_embed_google_album_js"));
     146        add_action('wp_footer', array($this, "hook_embed_google_album_js"));
    137147
    138148        $shortcodeId = (shortcode_atts(array(
     
    150160    public function embedsocial_feed_shortcode( $atts )
    151161    {
    152         $shortcodeId = (shortcode_atts(array(
    153             'id' => ''
    154         ), $atts));
    155 
    156         $out = "";
    157         if ($shortcodeId['id']) {
    158             $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
    159             $out .= "<script src='https://embedsocial.com/js/iframe.js'></script><iframe style='border: 0; width: 100%; height: 100%;' scrolling=no src='https://embedsocial.com/facebook_album/pro_embed_posts/{$shortcodeId['id']}'></iframe><script>iFrameResize();</script>";
     162        add_action('wp_footer', array($this, "hook_embed_socialfeed_js"));
     163
     164        $shortcodeId = (shortcode_atts(array(
     165            'id' => ''
     166        ), $atts));
     167
     168        $out = "";
     169        if ($shortcodeId['id']) {
     170            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     171            $out .= "<div class='embedsocial-socialfeed' data-ref='{$shortcodeId['id']}'></div>";
    160172        }
    161173        return $out;
     
    164176    public function embedsocial_reviews_album_shortcode( $atts )
    165177    {
    166         add_action('wp_footer', array($this,"hook_embed_reviews_js"));
     178        add_action('wp_footer', array($this, "hook_embed_reviews_js"));
    167179
    168180        $shortcodeId = (shortcode_atts(array(
     
    180192    public function embedsocial_google_reviews_album_shortcode( $atts )
    181193    {
    182         add_action('wp_footer', array($this,"hook_embed_google_reviews_js"));
     194        add_action('wp_footer', array($this, "hook_embed_google_reviews_js"));
    183195
    184196        $shortcodeId = (shortcode_atts(array(
     
    196208    public function embedsocial_custom_reviews_album_shortcode( $atts )
    197209    {
    198         add_action('wp_footer', array($this,"hook_embed_custom_reviews_js"));
     210        add_action('wp_footer', array($this, "hook_embed_custom_reviews_js"));
    199211
    200212        $shortcodeId = (shortcode_atts(array(
     
    209221        return $out;
    210222    }
     223
     224    public function embedsocial_stories_shortcode( $atts )
     225    {
     226        add_action('wp_footer', array($this, "hook_embed_story_js"));
     227
     228        $shortcodeId = (shortcode_atts(array(
     229            'id' => ''
     230        ), $atts));
     231
     232        $out = "";
     233        if ($shortcodeId['id']) {
     234            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     235            $out .= "<div class='embedsocial-stories' data-ref='{$shortcodeId['id']}'></div>";
     236        }
     237        return $out;
     238    }
    211239}
    212240
    213241$plugin = new EmbedSocialPlugin();
    214242
    215 add_shortcode('embedsocial_album', array($plugin,'embedsocial_fb_album_shortcode'));
    216 add_shortcode('embedsocial_gallery', array($plugin,'embedsocial_fb_gallery_shortcode'));
    217 add_shortcode('embedsocial_instagram', array($plugin,'embedsocial_instagram_album_shortcode'));
    218 add_shortcode('embedsocial_twitter', array($plugin,'embedsocial_twitter_album_shortcode'));   
    219 add_shortcode('embedsocial_google_album', array($plugin,'embedsocial_google_album_shortcode')); 
    220 add_shortcode('embedsocial_feed', array($plugin,'embedsocial_feed_shortcode'));   
    221 add_shortcode('embedsocial_reviews', array($plugin,'embedsocial_reviews_album_shortcode'));
    222 add_shortcode('embedsocial_google_reviews', array($plugin,'embedsocial_google_reviews_album_shortcode'));
    223 add_shortcode('embedsocial_custom_reviews', array($plugin,'embedsocial_custom_reviews_album_shortcode'));
     243add_shortcode('embedsocial_album', array($plugin, 'embedsocial_fb_album_shortcode'));
     244add_shortcode('embedsocial_gallery', array($plugin, 'embedsocial_fb_gallery_shortcode'));
     245add_shortcode('embedsocial_instagram', array($plugin, 'embedsocial_instagram_album_shortcode'));
     246add_shortcode('embedsocial_twitter', array($plugin, 'embedsocial_twitter_album_shortcode'));   
     247add_shortcode('embedsocial_google_album', array($plugin, 'embedsocial_google_album_shortcode')); 
     248add_shortcode('embedsocial_feed', array($plugin, 'embedsocial_feed_shortcode'));   
     249add_shortcode('embedsocial_reviews', array($plugin, 'embedsocial_reviews_album_shortcode'));
     250add_shortcode('embedsocial_google_reviews', array($plugin, 'embedsocial_google_reviews_album_shortcode'));
     251add_shortcode('embedsocial_custom_reviews', array($plugin, 'embedsocial_custom_reviews_album_shortcode'));
     252add_shortcode('embedsocial_stories', array($plugin, 'embedsocial_stories_shortcode'));
    224253?>
  • embedalbum-pro/trunk/readme.txt

    r1741511 r1826201  
    55
    66Requires at least: 4.7
    7 Tested up to: 4.7
    8 Stable tag: 1.0.12
     7Tested up to: 4.9
     8Stable tag: 1.0.14
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.