Plugin Directory

Changeset 1161051


Ignore:
Timestamp:
05/15/2015 10:12:10 AM (11 years ago)
Author:
revendless.com
Message:

Update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • revendless/trunk/revendless.php

    r1146964 r1161051  
    154154    public function initShortCodes()
    155155    {
    156         add_shortcode('rev-widget', array(&$this, 'addWidgetShortCodes'));
    157 
     156        /* @fix: keep previous shortcodes working */
     157        add_shortcode('rev-widget', array(&$this, 'addCarouselShortCode'));
     158
     159        /* shortcodes */
     160        add_shortcode('rev-carousel', array(&$this, 'addCarouselShortCode'));
     161        add_shortcode('rev-board', array(&$this, 'addBoardShortCode'));
     162
     163        /* adds shortcodes to wordpress excerpts and widgets */
    158164        add_filter('the_excerpt', 'do_shortcode');
    159165        add_filter('widget_text', 'do_shortcode');
     
    161167
    162168    /**
    163      * Add widget short codes
     169     * Add carousel short code
    164170     *
    165171     * @param array $atts
    166172     * @return void
    167173     */
    168     public function addWidgetShortCodes($atts)
     174    public function addCarouselShortCode($atts)
    169175    {
    170176        $atts = shortcode_atts(array(
     
    175181
    176182        $output = '<!-- Product integrations powered by Revendless / http://www.revendless.com -->'."\n";
    177         $output.= '<div class="rev-widget" data-type="product"'.$ids.'></div>'."\n";
     183        $output.= '<div class="rev-carousel" data-type="product"'.$ids.'></div>'."\n";
     184
     185        return $output;
     186    }
     187
     188    /**
     189     * Add board short code
     190     *
     191     * @param array $atts
     192     * @return void
     193     */
     194    public function addBoardShortCode($atts)
     195    {
     196        $atts = shortcode_atts(array(
     197            'ids' => null,
     198        ), $atts);
     199
     200        $ids = (!is_null($atts['ids'])) ? ' data-ids="'.$atts['ids'].'"' : '';
     201
     202        $output = '<!-- Product integrations powered by Revendless / http://www.revendless.com -->'."\n";
     203        $output.= '<div class="rev-board" data-type="product"'.$ids.'></div>'."\n";
    178204
    179205        return $output;
Note: See TracChangeset for help on using the changeset viewer.