nggShowGalleryTags

NggShowGalleryTags() - create a gallery based on the tags.

Description

nggShowGalleryTags( (string) $taglist, (string) $template = '', (string) $sorting = 'ASC' ); 

Parameters (3)

0. $taglist (string)
List of tags as csv
1. $template — Optional. (string) => ''
The template.
2. $sorting — Optional. (string) => 'ASC'
The sorting.

Usage

  1. if ( !function_exists( 'nggShowGalleryTags' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextcellent-gallery/nggfunctions.php'; 
  3.  
  4. // list of tags as csv 
  5. $taglist = ''; 
  6.  
  7. // The template. 
  8. $template = ''; 
  9.  
  10. // The sorting. 
  11. $sorting = 'ASC'; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = nggShowGalleryTags($taglist, $template, $sorting); 
  15.  

Defined (1)

The function is defined in the following location(s).

/nggfunctions.php  
  1. function nggShowGalleryTags($taglist, $template = '', $sorting = 'ASC') { 
  2.  
  3. // $_GET from wp_query 
  4. $pid = get_query_var('pid'); 
  5. $pageid = get_query_var('pageid'); 
  6.  
  7. // get now the related images 
  8. $picturelist = nggTags::find_images_for_tags($taglist , $sorting); 
  9.  
  10. // look for ImageBrowser if we have a $_GET('pid') 
  11. if ( $pageid == get_the_ID() || !is_home() ) 
  12. if (!empty( $pid )) { 
  13. $out = nggCreateImageBrowser( $picturelist, $template ); 
  14. return $out; 
  15.  
  16. // go on if not empty 
  17. if ( empty($picturelist) ) 
  18. return; 
  19.  
  20. // show gallery 
  21. if ( is_array($picturelist) ) 
  22. $out = nggCreateGallery($picturelist, false, $template); 
  23.  
  24. $out = apply_filters('ngg_show_gallery_tags_content', $out, $taglist); 
  25. return $out;