GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Variables
field-post_image-html.php File Reference

Go to the source code of this file.

Variables

 $ary = explode("|:|", $value)
 
 $caption = count($ary) > 2 ? $ary[2] : ""
 
 $description = count($ary) > 3 ? $ary[3] : ""
 
 $entry = $gravityview->entry->as_entry()
 
if(! isset( $gravityview)||empty( $gravityview->template)) $field = $gravityview->field->field
 The default post_image field output template. More...
 
 $field_settings = $gravityview->field->as_configuration()
 
 $image = new GravityView_Image( $image_atts )
 
 $image_atts
 
 $image_meta
 
 $link_atts = array()
 
if( $gravityview->view->settings->get( 'lightbox')) $link_atts ['href'] = $href
 
 $link_atts ['title'] = $title
 
 $output = '<'.$wrappertag.' class="gv-image">'
 
 $showlabels = apply_filters( 'gravityview_post_image_meta_show_labels', true )
 
 $title = count($ary) > 1 ? $ary[1] : ""
 
 $url = count($ary) > 0 ? $ary[0] : ""
 
 $value = $gravityview->value
 
 $wrappertag = GFFormsModel::is_html5_enabled() ? 'figure' : 'div'
 
if(! empty( $field['postFeaturedImage']) &&! empty( $field_settings['dynamic_data']) &&! empty( $entry['post_id']) &&has_post_thumbnail( $entry['post_id'])) if(! empty( $field_settings['link_to_post'])) else if(! empty( $field_settings['show_as_link'])) else
 

Variable Documentation

◆ $ary

$ary = explode("|:|", $value)

Definition at line 27 of file field-post_image-html.php.

◆ $caption

$caption = count($ary) > 2 ? $ary[2] : ""

Definition at line 30 of file field-post_image-html.php.

◆ $description

$description = count($ary) > 3 ? $ary[3] : ""

Definition at line 31 of file field-post_image-html.php.

◆ $entry

$entry = $gravityview->entry->as_entry()

Definition at line 16 of file field-post_image-html.php.

◆ $field

if (! isset($gravityview)||empty($gravityview->template)) $field = $gravityview->field->field

The default post_image field output template.

$gravityview

Since
2.0

Definition at line 14 of file field-post_image-html.php.

◆ $field_settings

$field_settings = $gravityview->field->as_configuration()

Definition at line 17 of file field-post_image-html.php.

◆ $image

$image = new GravityView_Image( $image_atts )

Definition at line 103 of file field-post_image-html.php.

◆ $image_atts

$image_atts
Initial value:
= array(
'src' => $url,
'alt' => ( !empty( $caption ) ? $caption : $title ),
'validate_src' => false,
)
$url
$title
$caption

Definition at line 97 of file field-post_image-html.php.

◆ $image_meta

$image_meta
Initial value:
= apply_filters( 'gravityview_post_image_meta', array(
'title' => array(
'label' => esc_attr_x( 'Title:', 'Post Image field title heading', 'gk-gravityview'),
'value' => $title,
'tag_label' => 'span',
'tag_value' => 'div'
),
'caption' => array(
'label' => esc_attr_x( 'Caption:', 'Post Image field caption heading', 'gk-gravityview'),
'value' => $caption,
'tag_label' => 'span',
'tag_value' => GFFormsModel::is_html5_enabled() ? 'figcaption' : 'div',
),
'description' => array(
'label' => esc_attr_x( 'Description:', 'Post Image field description heading', 'gk-gravityview'),
'value' => $description,
'tag_label' => 'span',
'tag_value' => 'div'
),
))
$description
$title
$caption

Definition at line 111 of file field-post_image-html.php.

◆ $link_atts [1/3]

$link_atts = array()

Definition at line 33 of file field-post_image-html.php.

◆ $link_atts [2/3]

if ($gravityview->view->settings->get('lightbox')) $link_atts[ 'href'] = $href

Definition at line 88 of file field-post_image-html.php.

◆ $link_atts [3/3]

$link_atts[ 'title'] = $title

Definition at line 91 of file field-post_image-html.php.

◆ $output

foreach ((array) $image_meta as $key=> $meta) $output = '<'.$wrappertag.' class="gv-image">'

Definition at line 143 of file field-post_image-html.php.

◆ $showlabels

$showlabels = apply_filters( 'gravityview_post_image_meta_show_labels', true )

Definition at line 140 of file field-post_image-html.php.

◆ $title

$title = count($ary) > 1 ? $ary[1] : ""

Definition at line 29 of file field-post_image-html.php.

◆ $url

$url = count($ary) > 0 ? $ary[0] : ""

Definition at line 28 of file field-post_image-html.php.

◆ $value

$value = $gravityview->value

Definition at line 15 of file field-post_image-html.php.

◆ $wrappertag

$wrappertag = GFFormsModel::is_html5_enabled() ? 'figure' : 'div'

Definition at line 133 of file field-post_image-html.php.

◆ else

if (! empty($field[ 'postFeaturedImage']) &&! empty($field_settings[ 'dynamic_data']) &&! empty($entry[ 'post_id']) &&has_post_thumbnail($entry[ 'post_id'])) if (! empty($field_settings[ 'link_to_post'])) else if (! empty($field_settings[ 'show_as_link'])) else
Initial value:
Since
1.5.4

$field['postFeaturedImage'] - holds if the Post Image field is set as post featured image $field_settings['dynamic_data'] - whether the field content should be fetched from the Post (dynamic data) or from the GF entry

Dynamic data (get post featured image instead of GF entry field)

Definition at line 75 of file field-post_image-html.php.