Changeset 1161051
- Timestamp:
- 05/15/2015 10:12:10 AM (11 years ago)
- File:
-
- 1 edited
-
revendless/trunk/revendless.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
revendless/trunk/revendless.php
r1146964 r1161051 154 154 public function initShortCodes() 155 155 { 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 */ 158 164 add_filter('the_excerpt', 'do_shortcode'); 159 165 add_filter('widget_text', 'do_shortcode'); … … 161 167 162 168 /** 163 * Add widget short codes169 * Add carousel short code 164 170 * 165 171 * @param array $atts 166 172 * @return void 167 173 */ 168 public function add WidgetShortCodes($atts)174 public function addCarouselShortCode($atts) 169 175 { 170 176 $atts = shortcode_atts(array( … … 175 181 176 182 $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"; 178 204 179 205 return $output;
Note: See TracChangeset
for help on using the changeset viewer.