Jetpack_Tiled_Gallery_Item

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

Defined (1)

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

/modules/tiled-gallery/tiled-gallery/tiled-gallery-item.php  
  1. abstract class Jetpack_Tiled_Gallery_Item { 
  2. public $image; 
  3.  
  4. public function __construct( $attachment_image, $needs_attachment_link, $grayscale ) { 
  5. $this->image = $attachment_image; 
  6. $this->grayscale = $grayscale; 
  7.  
  8. $this->image_title = $this->image->post_title; 
  9.  
  10. $this->image_alt = get_post_meta( $this->image->ID, '_wp_attachment_image_alt', true ); 
  11. // If no Alt value, use the caption 
  12. if ( empty( $this->image_alt ) && ! empty( $this->image->post_excerpt ) ) { 
  13. $this->image_alt = trim( strip_tags( $this->image->post_excerpt ) ); 
  14. // If still no Alt value, use the title 
  15. if ( empty( $this->image_alt ) && ! empty( $this->image->post_title ) ) { 
  16. $this->image_alt = trim( strip_tags( $this->image->post_title ) ); 
  17.  
  18. $this->orig_file = wp_get_attachment_url( $this->image->ID ); 
  19. $this->link = $needs_attachment_link ? get_attachment_link( $this->image->ID ) : $this->orig_file; 
  20.  
  21. $this->img_src = add_query_arg( array( 'w' => $this->image->width, 'h' => $this->image->height, 'crop' => true ), $this->orig_file ); 
  22.  
  23.  
  24. public function fuzzy_image_meta() { 
  25. $meta = wp_get_attachment_metadata( $this->image->ID ); 
  26. $img_meta = ( ! empty( $meta['image_meta'] ) ) ? (array) $meta['image_meta'] : array(); 
  27. if ( ! empty( $img_meta ) ) { 
  28. foreach ( $img_meta as $k => $v ) { 
  29. if ( 'latitude' == $k || 'longitude' == $k ) 
  30. unset( $img_meta[$k] ); 
  31.  
  32. return $img_meta; 
  33.  
  34. public function meta_width() { 
  35. $meta = wp_get_attachment_metadata( $this->image->ID ); 
  36. return isset( $meta['width'] ) ? intval( $meta['width'] ) : ''; 
  37.  
  38. public function meta_height() { 
  39. $meta = wp_get_attachment_metadata( $this->image->ID ); 
  40. return isset( $meta['height'] ) ? intval( $meta['height'] ) : ''; 
  41.  
  42. public function medium_file() { 
  43. $medium_file_info = wp_get_attachment_image_src( $this->image->ID, 'medium' ); 
  44. $medium_file = isset( $medium_file_info[0] ) ? $medium_file_info[0] : ''; 
  45. return $medium_file; 
  46.  
  47. public function large_file() { 
  48. $large_file_info = wp_get_attachment_image_src( $this->image->ID, 'large' ); 
  49. $large_file = isset( $large_file_info[0] ) ? $large_file_info[0] : ''; 
  50. return $large_file;