Plugin Directory

Changeset 1839279


Ignore:
Timestamp:
03/13/2018 11:20:43 AM (8 years ago)
Author:
embedsocial
Message:

Added Stories Gallery support

Location:
embedalbum-pro/trunk
Files:
2 edited

Legend:

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

    r1827843 r1839279  
    66Author: EmbedSocial
    77Author URI: http://www.embedsocial.com
    8 Version: 1.1.6
     8Version: 1.1.8
    99 */
    1010defined( 'ABSPATH' ) or die;
     
    7878    }
    7979
     80    public function hook_embed_story_popup_js() {
     81        wp_register_script('EmbedSocialStoriesPopupScript', $this->urlEmbedScripts.'stp.js');
     82        wp_enqueue_script('EmbedSocialStoriesPopupScript', $this->urlEmbedScripts.'stp.js');
     83    }
     84
     85    public function hook_embed_story_gallery_js() {
     86        wp_register_script('EmbedSocialStoryGalleryScript', $this->urlEmbedScripts.'stg.js');
     87        wp_enqueue_script('EmbedSocialStoryGalleryScript', $this->urlEmbedScripts.'stg.js');
     88    }
     89
    8090    public function embedsocial_fb_album_shortcode( $atts )
    8191    {
     
    234244            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
    235245            $out .= "<div class='embedsocial-stories' data-ref='{$shortcodeId['id']}'></div>";
     246        }
     247        return $out;
     248    }
     249
     250    public function embedsocial_stories_popup_shortcode( $atts )
     251    {
     252        add_action('wp_footer', array($this, "hook_embed_story_popup_js"));
     253
     254        $shortcodeId = (shortcode_atts(array(
     255            'id' => ''
     256        ), $atts));
     257
     258        $out = "";
     259        if ($shortcodeId['id']) {
     260            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     261            $out .= "<div class='embedsocial-stories-popup' data-ref='{$shortcodeId['id']}'></div>";
     262        }
     263        return $out;
     264    }
     265
     266    public function embedsocial_story_gallery_shortcode( $atts )
     267    {
     268        add_action('wp_footer', array($this, "hook_embed_story_gallery_js"));
     269
     270        $shortcodeId = (shortcode_atts(array(
     271            'id' => ''
     272        ), $atts));
     273
     274        $out = "";
     275        if ($shortcodeId['id']) {
     276            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     277            $out .= "<div class='embedsocial-story-gallery' data-ref='{$shortcodeId['id']}'></div>";
    236278        }
    237279        return $out;
     
    251293add_shortcode('embedsocial_custom_reviews', array($plugin, 'embedsocial_custom_reviews_album_shortcode'));
    252294add_shortcode('embedsocial_stories', array($plugin, 'embedsocial_stories_shortcode'));
     295add_shortcode('embedsocial_stories_popup', array($plugin, 'embedsocial_stories_popup_shortcode'));
     296add_shortcode('embedsocial_story_gallery', array($plugin, 'embedsocial_story_gallery_shortcode'));
    253297?>
  • embedalbum-pro/trunk/readme.txt

    r1829992 r1839279  
    55Requires at least: 4.0
    66Tested up to: 4.9.4
    7 Stable tag: 1.1.6
     7Stable tag: 1.1.8
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.