Plugin Directory

Changeset 1842199


Ignore:
Timestamp:
03/18/2018 02:52:01 PM (8 years ago)
Author:
embedsocial
Message:

Updated shortcodes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • embedstories/trunk/embedstories.php

    r1836427 r1842199  
    88Version: 0.7.1
    99 */
     10
    1011defined( 'ABSPATH' ) or die;
    1112class EmbedStoriesPlugin {
    1213
     14    private $url = "https://embedsocial.com/facebook_album/";
    1315    private $urlEmbedScripts = "https://embedsocial.com/embedscript/";
    1416
     
    2729    public function __construct() {}
    2830
    29     public function hook_embed_story_js() {
    30         wp_register_script('EmbedSocialStoriesScript', $this->urlEmbedScripts.'sts.js');
    31         wp_enqueue_script('EmbedSocialStoriesScript', $this->urlEmbedScripts.'sts.js');
    32     }
    33 
    34     public function embedsocial_story_gallery_shortcode( $atts )
     31    public function hook_embed_gallery_js() {
     32        wp_register_script('EmbedSocialGalleryScript', $this->urlEmbedScripts.'biw.js');
     33        wp_enqueue_script('EmbedSocialGalleryScript', $this->urlEmbedScripts.'biw.js');
     34    }
     35
     36    public function hook_embed_instagram_js() {
     37        wp_register_script('EmbedSocialInstagramScript', $this->urlEmbedScripts.'in.js');
     38        wp_enqueue_script('EmbedSocialinstagramScript', $this->urlEmbedScripts.'in.js');
     39    }
     40
     41    public function hook_embed_twitter_js() {
     42        wp_register_script('EmbedSocialTwitterScript', $this->urlEmbedScripts.'ti.js');
     43        wp_enqueue_script('EmbedSocialtwitterScript', $this->urlEmbedScripts.'ti.js');
     44    }
     45
     46    public function hook_embed_album_js() {
     47        wp_register_script('EmbedSocialScript', $this->urlEmbedScripts.'eiw.js');
     48        wp_enqueue_script('EmbedSocialScript', $this->urlEmbedScripts.'eiw.js');
     49    }
     50
     51    public function hook_embed_google_album_js() {
     52        wp_register_script('EmbedSocialGoogleScript', $this->urlEmbedScripts.'gi.js');
     53        wp_enqueue_script('EmbedSocialGoogleScript', $this->urlEmbedScripts.'gi.js');
     54    }
     55
     56    public function hook_embed_socialfeed_js() {
     57        wp_register_script('EmbedSocialSocialFeedScript', $this->urlEmbedScripts.'sf.js');
     58        wp_enqueue_script('EmbedSocialSocialFeedScript', $this->urlEmbedScripts.'sf.js');
     59    }
     60
     61    public function hook_embed_reviews_js() {
     62        wp_register_script('EmbedSocialReviewsScript', $this->urlEmbedScripts.'ri.js');
     63        wp_enqueue_script('EmbedSocialReviewsScript', $this->urlEmbedScripts.'ri.js');
     64    }
     65
     66    public function hook_embed_google_reviews_js() {
     67        wp_register_script('EmbedSocialGoogleReviewsScript', $this->urlEmbedScripts.'gri.js');
     68        wp_enqueue_script('EmbedSocialGoogleReviewsScript', $this->urlEmbedScripts.'gri.js');
     69    }
     70
     71    public function hook_embed_custom_reviews_js() {
     72        wp_register_script('EmbedSocialCustomReviewsScript', $this->urlEmbedScripts.'cri.js');
     73        wp_enqueue_script('EmbedSocialCustomReviewsScript', $this->urlEmbedScripts.'cri.js');
     74    }
     75
     76    public function hook_embed_story_js() {
     77        wp_register_script('EmbedSocialStoriesScript', $this->urlEmbedScripts.'st.js');
     78        wp_enqueue_script('EmbedSocialStoriesScript', $this->urlEmbedScripts.'st.js');
     79    }
     80
     81    public function hook_embed_story_popup_js() {
     82        wp_register_script('EmbedSocialStoriesPopupScript', $this->urlEmbedScripts.'stp.js');
     83        wp_enqueue_script('EmbedSocialStoriesPopupScript', $this->urlEmbedScripts.'stp.js');
     84    }
     85
     86    public function hook_embed_story_gallery_js() {
     87        wp_register_script('EmbedSocialStoryGalleryScript', $this->urlEmbedScripts.'stg.js');
     88        wp_enqueue_script('EmbedSocialStoryGalleryScript', $this->urlEmbedScripts.'stg.js');
     89    }
     90
     91    public function embedsocial_fb_album_shortcode( $atts )
     92    {
     93        add_action('wp_footer', array($this,"hook_embed_album_js"));
     94
     95        $shortcodeId = (shortcode_atts(array(
     96            'id' => ''
     97        ), $atts));
     98
     99        $out = "";
     100        if ($shortcodeId['id']) {
     101            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     102            $out .= "<div class='embedsocial-album' data-ref='{$shortcodeId['id']}'></div>";
     103        }
     104        return $out;
     105    }
     106
     107    public function embedsocial_fb_gallery_shortcode( $atts )
     108    {
     109        add_action('wp_footer', array($this, "hook_embed_gallery_js"));
     110
     111        $shortcodeId = (shortcode_atts(array(
     112            'id' => ''
     113        ), $atts));
     114
     115        $out = "";
     116        if ($shortcodeId['id']) {
     117            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     118            $out .= "<div class='embedsocial-gallery' data-ref='{$shortcodeId['id']}'></div>";
     119        }
     120        return $out;
     121    }   
     122
     123    public function embedsocial_instagram_album_shortcode( $atts )
     124    {
     125        add_action('wp_footer', array($this, "hook_embed_instagram_js"));
     126
     127        $shortcodeId = (shortcode_atts(array(
     128            'id' => ''
     129        ), $atts));
     130
     131        $out = "";
     132        if ($shortcodeId['id']) {
     133            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     134            $out .= "<div class='embedsocial-instagram' data-ref='{$shortcodeId['id']}'></div>";
     135        }
     136        return $out;
     137    }
     138
     139    public function embedsocial_twitter_album_shortcode( $atts )
     140    {
     141        add_action('wp_footer', array($this, "hook_embed_twitter_js"));
     142
     143        $shortcodeId = (shortcode_atts(array(
     144            'id' => ''
     145        ), $atts));
     146
     147        $out = "";
     148        if ($shortcodeId['id']) {
     149            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     150            $out .= "<div class='embedsocial-twitter' data-ref='{$shortcodeId['id']}'></div>";
     151        }
     152        return $out;
     153    }
     154
     155    public function embedsocial_google_album_shortcode( $atts )
     156    {
     157        add_action('wp_footer', array($this, "hook_embed_google_album_js"));
     158
     159        $shortcodeId = (shortcode_atts(array(
     160            'id' => ''
     161        ), $atts));
     162
     163        $out = "";
     164        if ($shortcodeId['id']) {
     165            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     166            $out .= "<div class='embedsocial-google-place' data-ref='{$shortcodeId['id']}'></div>";
     167        }
     168        return $out;
     169    }
     170
     171    public function embedsocial_feed_shortcode( $atts )
     172    {
     173        add_action('wp_footer', array($this, "hook_embed_socialfeed_js"));
     174
     175        $shortcodeId = (shortcode_atts(array(
     176            'id' => ''
     177        ), $atts));
     178
     179        $out = "";
     180        if ($shortcodeId['id']) {
     181            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     182            $out .= "<div class='embedsocial-socialfeed' data-ref='{$shortcodeId['id']}'></div>";
     183        }
     184        return $out;
     185    }
     186
     187    public function embedsocial_reviews_album_shortcode( $atts )
     188    {
     189        add_action('wp_footer', array($this, "hook_embed_reviews_js"));
     190
     191        $shortcodeId = (shortcode_atts(array(
     192            'id' => ''
     193        ), $atts));
     194
     195        $out = "";
     196        if ($shortcodeId['id']) {
     197            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     198            $out .= "<div class='embedsocial-reviews' data-ref='{$shortcodeId['id']}'></div>";
     199        }
     200        return $out;
     201    }
     202
     203    public function embedsocial_google_reviews_album_shortcode( $atts )
     204    {
     205        add_action('wp_footer', array($this, "hook_embed_google_reviews_js"));
     206
     207        $shortcodeId = (shortcode_atts(array(
     208            'id' => ''
     209        ), $atts));
     210
     211        $out = "";
     212        if ($shortcodeId['id']) {
     213            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     214            $out .= "<div class='embedsocial-google-reviews' data-ref='{$shortcodeId['id']}'></div>";
     215        }
     216        return $out;
     217    }
     218   
     219    public function embedsocial_custom_reviews_album_shortcode( $atts )
     220    {
     221        add_action('wp_footer', array($this, "hook_embed_custom_reviews_js"));
     222
     223        $shortcodeId = (shortcode_atts(array(
     224            'id' => ''
     225        ), $atts));
     226
     227        $out = "";
     228        if ($shortcodeId['id']) {
     229            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     230            $out .= "<div class='embedsocial-custom-reviews' data-ref='{$shortcodeId['id']}'></div>";
     231        }
     232        return $out;
     233    }
     234
     235    public function embedsocial_stories_shortcode( $atts )
    35236    {
    36237        add_action('wp_footer', array($this, "hook_embed_story_js"));
     
    43244        if ($shortcodeId['id']) {
    44245            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     246            $out .= "<div class='embedsocial-stories' data-ref='{$shortcodeId['id']}'></div>";
     247        }
     248        return $out;
     249    }
     250
     251    public function embedsocial_stories_popup_shortcode( $atts )
     252    {
     253        add_action('wp_footer', array($this, "hook_embed_story_popup_js"));
     254
     255        $shortcodeId = (shortcode_atts(array(
     256            'id' => ''
     257        ), $atts));
     258
     259        $out = "";
     260        if ($shortcodeId['id']) {
     261            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
     262            $out .= "<div class='embedsocial-stories-popup' data-ref='{$shortcodeId['id']}'></div>";
     263        }
     264        return $out;
     265    }
     266
     267    public function embedsocial_story_gallery_shortcode( $atts )
     268    {
     269        add_action('wp_footer', array($this, "hook_embed_story_gallery_js"));
     270
     271        $shortcodeId = (shortcode_atts(array(
     272            'id' => ''
     273        ), $atts));
     274
     275        $out = "";
     276        if ($shortcodeId['id']) {
     277            $shortcodeId['id'] = sanitize_text_field($shortcodeId['id']);
    45278            $out .= "<div class='embedsocial-story-gallery' data-ref='{$shortcodeId['id']}'></div>";
    46279        }
     
    51284$plugin = new EmbedStoriesPlugin();
    52285
     286add_shortcode('embedsocial_album', array($plugin, 'embedsocial_fb_album_shortcode'));
     287add_shortcode('embedsocial_gallery', array($plugin, 'embedsocial_fb_gallery_shortcode'));
     288add_shortcode('embedsocial_instagram', array($plugin, 'embedsocial_instagram_album_shortcode'));
     289add_shortcode('embedsocial_twitter', array($plugin, 'embedsocial_twitter_album_shortcode'));   
     290add_shortcode('embedsocial_google_album', array($plugin, 'embedsocial_google_album_shortcode')); 
     291add_shortcode('embedsocial_feed', array($plugin, 'embedsocial_feed_shortcode'));   
     292add_shortcode('embedsocial_reviews', array($plugin, 'embedsocial_reviews_album_shortcode'));
     293add_shortcode('embedsocial_google_reviews', array($plugin, 'embedsocial_google_reviews_album_shortcode'));
     294add_shortcode('embedsocial_custom_reviews', array($plugin, 'embedsocial_custom_reviews_album_shortcode'));
     295add_shortcode('embedsocial_stories', array($plugin, 'embedsocial_stories_shortcode'));
     296add_shortcode('embedsocial_stories_popup', array($plugin, 'embedsocial_stories_popup_shortcode'));
    53297add_shortcode('embedsocial_story_gallery', array($plugin, 'embedsocial_story_gallery_shortcode'));
     298
     299
    54300?>
Note: See TracChangeset for help on using the changeset viewer.