Jetpack_Tiled_Gallery_Group

The Jetpack by WordPress.com Jetpack Tiled Gallery Group class.

Defined (1)

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

/modules/tiled-gallery/tiled-gallery/tiled-gallery-rectangular.php  
  1. class Jetpack_Tiled_Gallery_Group { 
  2. public function __construct( $images ) { 
  3. $this->images = $images; 
  4. $this->ratio = $this->get_ratio(); 
  5.  
  6. public function get_ratio() { 
  7. $ratio = 0; 
  8. foreach ( $this->images as $image ) { 
  9. if ( $image->ratio ) 
  10. $ratio += 1/$image->ratio; 
  11. if ( !$ratio ) 
  12. return 1; 
  13.  
  14. return 1/$ratio; 
  15.  
  16. public function items( $needs_attachment_link, $grayscale ) { 
  17. $items = array(); 
  18. foreach ( $this->images as $image ) { 
  19. $items[] = new Jetpack_Tiled_Gallery_Rectangular_Item( $image, $needs_attachment_link, $grayscale ); 
  20.  
  21. return $items;