Skip to main content

GravityView_Image

Generic class for generating image tag

Source: includes/class-gravityview-image.php:5

Details

  • Kind: class
  • Namespace: (global)

Methods

MethodDescription
__toString()Handle being treated as a string by returning the HTML
validate_image_src()Verify that the src URL matches image patterns.
get_image_extensions()Returns an array of file extensions recognized by GravityView as images.
set_image_size()Get default widths and heights for image size.
html()Return the HTML tag for the image

Method Reference

__toString()

function __toString()

Handle being treated as a string by returning the HTML

Returns

  • string — HTML of image

Source: includes/class-gravityview-image.php:53

validate_image_src()

function 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.

Source: includes/class-gravityview-image.php:91

get_image_extensions()

public static function get_image_extensions()

Returns an array of file extensions recognized by GravityView as images.

Returns

  • array

Since: 2.14.3

Source: includes/class-gravityview-image.php:111

set_image_size()

public function set_image_size( $string=null, $width=null, $height=null )

Get default widths and heights for image size.

Parameters

NameTypeDefaultDescription
$stringnull
$widthnull
$heightnull

Returns

  • void

Source: includes/class-gravityview-image.php:133

html()

public function html()

Return the HTML tag for the image

Returns

  • string — HTML of the image

Source: includes/class-gravityview-image.php:219