GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Data Fields
GravityView_Image Class Reference

Generic class for generating image tag. More...

Public Member Functions

 __construct ($atts=array())
 
 __toString ()
 Handle being treated as a string by returning the HTML. More...
 
 html ()
 Return the HTML tag for the image. More...
 
 set_image_size ($string=NULL, $width=NULL, $height=NULL)
 Get default widths and heights for image size. More...
 
 validate_image_src ()
 Verify that the src URL matches image patterns. More...
 

Data Fields

 $alt
 
 $class = NULL
 
 $getimagesize = false
 
 $height
 
 $size = NULL
 
 $src
 
 $style = NULL
 
 $title
 
 $validate_src = true
 
 $width
 

Detailed Description

Generic class for generating image tag.

Definition at line 5 of file class-gravityview-image.php.

Constructor & Destructor Documentation

__construct (   $atts = array())

Definition at line 52 of file class-gravityview-image.php.

References set_image_size().

Member Function Documentation

__toString ( )

Handle being treated as a string by returning the HTML.

Returns
string HTML of image

Definition at line 47 of file class-gravityview-image.php.

References html().

html ( )

Return the HTML tag for the image.

Returns
string HTML of the image
Runs Filter:
gravityview_image_html Filter the HTML image output
Parameters
string$htmlthe generated image html
GravityView_Image$thisThe current image object

Definition at line 177 of file class-gravityview-image.php.

References $html, and validate_image_src().

Referenced by __toString().

set_image_size (   $string = NULL,
  $width = NULL,
  $height = NULL 
)

Get default widths and heights for image size.

Returns
void
Runs Filter:
gravityview_image_sizes Modify the image size presets used by GravityView_Image class
Parameters
array$image_sizesArray of image sizes with the key being the size slug, and the value being an array with width and height defined, in pixels

Definition at line 106 of file class-gravityview-image.php.

References $height, and $width.

Referenced by __construct().

validate_image_src ( )

Verify that the src URL matches image patterns.

Yes, images can not have extensions, but this is a basic check. To disable this, set validate_src to false when instantiating the object.

Returns
boolean True: matches pattern; False: does not match pattern.
Runs Filter:
gravityview_image_extensions Extensions that GravityView recognizes as valid images to be shown in an img tag
Parameters
array$image_extsDefault: `['jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico']`

Definition at line 86 of file class-gravityview-image.php.

Referenced by html().

Field Documentation

$alt

Definition at line 7 of file class-gravityview-image.php.

$class = NULL

Definition at line 17 of file class-gravityview-image.php.

$getimagesize = false

Definition at line 35 of file class-gravityview-image.php.

$height

Definition at line 11 of file class-gravityview-image.php.

Referenced by set_image_size().

$size = NULL

Definition at line 29 of file class-gravityview-image.php.

$src

Definition at line 8 of file class-gravityview-image.php.

$style = NULL

Definition at line 23 of file class-gravityview-image.php.

$title

Definition at line 9 of file class-gravityview-image.php.

$validate_src = true

Definition at line 41 of file class-gravityview-image.php.

$width

Definition at line 10 of file class-gravityview-image.php.

Referenced by set_image_size().


The documentation for this class was generated from the following file: