Example #1
0
 function show_tags($atts)
 {
     extract(shortcode_atts(array('gallery' => '', 'album' => ''), $atts));
     if (!empty($album)) {
         $out = nggShowAlbumTags($album);
     } else {
         $out = nggShowGalleryTags($gallery);
     }
     return $out;
 }
Example #2
0
 /**
  * nggtags shortcode implementation
  * 20140120: Improved: template option.
  * Reference: based on improvement of Tony Howden's code
  * http://howden.net.au/thowden/2012/12/nextgen-gallery-wordpress-nggtags-template-caption-option/
  * Included template to galleries and albums
  * Included sorting mode: ASC/DESC/RAND
  * @param $atts
  * @return $out
  */
 function show_tags($atts)
 {
     extract(shortcode_atts(array('gallery' => '', 'album' => '', 'template' => '', 'sort' => ''), $atts));
     //gallery/album contains tag list comma separated of terms to filtering out.
     //Counterintuitive: I'd like something like tags='red,green' and then to specify album/gallery instead.
     $modes = array('ASC', 'DESC', 'RAND');
     $sorting = strtoupper($sort);
     if (!in_array(strtoupper($sorting), $modes)) {
         $sorting = 'NOTSET';
     }
     if (!empty($album)) {
         $out = nggShowAlbumTags($album, $template, $sorting);
     } else {
         $out = nggShowGalleryTags($gallery, $template, $sorting);
     }
     return $out;
 }