Support » Plugin: Slideshow » Support for shortcodes

  • added support for shortcodes in slides. Would be great if this patch could be pulled into the next release, or if shortcode support would be added in another way. Saw this on your TODOs, so here it’s solved…

    https://github.com/Boonstra/Slideshow/pull/20

    Index: views/SlideshowPluginSlideshowSlide/frontend_attachment.php
    ===================================================================
    --- views/SlideshowPluginSlideshowSlide/frontend_attachment.php	(.../slideshow-jquery-image-gallery)	(revision 21177)
    +++ views/SlideshowPluginSlideshowSlide/frontend_attachment.php	(.../slideshow-jquery-image-gallery-custom)	(revision 27322)
    @@ -4,7 +4,7 @@
     
     	$properties = $data->properties;
     
    -	$title = $description = $url = $urlTarget = $alternativeText = $noFollow = $postId = '';
    +	$title = $description = $descriptionText = $url = $urlTarget = $alternativeText = $noFollow = $postId = '';
     
     	$titleElementTag = $descriptionElementTag = SlideshowPluginSlideInserter::getElementTag();
     
    @@ -21,6 +21,7 @@
     	if (isset($properties['description']))
     	{
     		$description = trim(SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['description']));
    +		$descriptionText = trim($properties['description']);
     	}
     
     	if (isset($properties['descriptionElementTagID']))
    @@ -124,8 +125,12 @@
     			if ($imageAvailable): ?>
     
     				<div class="slideshow_slide slideshow_slide_image">
    -					<?php echo $anchorTag; ?>
    -						<img />" alt="<?php echo $alternativeText; ?>" <?php echo ($imageWidth > 0) ? 'width="' . $imageWidth . '"' : ''; ?> <?php echo ($imageHeight > 0) ? 'height="' . $imageHeight . '"' : ''; ?> />
    +					<?php
    +						echo $anchorTag;
    +						// do shortcodes in slides...
    +						echo !empty($descriptionText) ? do_shortcode($descriptionText): '';
    +					?>
    +					<img />" alt="<?php echo $alternativeText; ?>" <?php echo ($imageWidth > 0) ? 'width="' . $imageWidth . '"' : ''; ?> <?php echo ($imageHeight > 0) ? 'height="' . $imageHeight . '"' : ''; ?> />
     					<?php echo $endAnchorTag; ?>
     					<div class="slideshow_description_box slideshow_transparent">
     						<?php echo !empty($title) ? '<' . $titleElementTag . ' class="slideshow_title">' . $anchorTag . $title . $endAnchorTag . '</' . $titleElementTag . '>' : ''; ?>
    • This topic was modified 7 months, 3 weeks ago by  cgaffga.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thank you for sharing this patch. I am sure many using this plugin will implement your fix.

    Kind regards

    nizzickle

    (@nizzickle)

    Hi,

    Newby here… Does anyone know how I can implement the fix? Not sure where to put the code.

    Many thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Support for shortcodes’ is closed to new replies.