getGals

The Google Drive WP Media getGals function.

Description

getGals( $paged ); 

Parameters (1)

0. $paged
The paged.

Usage

  1. if ( !function_exists( 'getGals' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-drive-wp-media/google-drive-wp-media-galleries.php'; 
  3.  
  4. // The paged. 
  5. $paged = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = getGals($paged); 
  9.  

Defined (1)

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

/google-drive-wp-media-galleries.php  
  1. function getGals($paged) { 
  2. $type = 'gdwpm_galleries'; 
  3. $args=array( 
  4. 'post_type' => $type,  
  5. 'post_status' => 'publish',  
  6. 'posts_per_page' => -1,  
  7. 'posts_per_page' => 10,  
  8. 'paged' => $paged,  
  9. 'caller_get_posts'=> 1); 
  10. $my_query = null; 
  11. $my_query = new WP_Query($args); 
  12. if( $my_query->have_posts() ) { 
  13. echo '<table><tr><th></th><th>Title</th><th>Shortcode</th><th>Album</th><th>Action</th></tr><tr>'; 
  14. while ($my_query->have_posts()) : $my_query->the_post();  
  15. echo '<tr><td><div class="ui-corner-all" style="width:32px;height:32px; overflow:hidden;"><img src="' .GD_BASE_PATH. get_post_meta( get_the_ID(), 'sampleImage', true ) . '" title="'.get_the_ID().'" height="32px" /></div></td> 
  16. <td style="padding:0 5px 0 3px;"><a href="' . get_permalink() . '" target="_blank" title="Permanent Link to ' . get_the_title() . '">' . get_the_title() . '</a></td> 
  17. <td style="padding:0 3px 0 3px;"><code>[gdwpm-gallery id="' . get_the_ID() . '"]</code></td> 
  18. <td style="padding:0 3px 0 3px;">' . get_the_term_list( get_the_ID(), 'gdwpm_album', '', ', ' ) . '</td> 
  19. <td style="padding:0 0 0 7px;"><button id="galedit" class="galedit" title="Send to Collector" data-galedit="'.get_post_meta( get_the_ID(), 'base64data', true ).'">Edit</button> | <button id="galdelet" class="galdelet ui-state-disabled" title="Permanently deleted" data-galdelet="' . get_the_ID() . '">Delete</button></td></tr>'; 
  20.  
  21. endwhile; 
  22. echo '</table><small>*Embed gallery: copy shortcode, paste into your post editor.</small>'; 
  23.  
  24. }else{ 
  25. if($paged > 1) { 
  26. return true; 
  27. }else{ 
  28. echo 'No galleries found.'; 
  29. wp_reset_query();