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

Go to the source code of this file.

Namespaces

 GravityView
 GPL2+
 

Variables

 $ary = explode("|:|", $value)
 
 $caption = count($ary) > 2 ? $ary[2] : ""
 
 $description = count($ary) > 3 ? $ary[3] : ""
 
 $gravityview_view = GravityView_View::getInstance()
 
 $image = new GravityView_Image( $image_atts )
 
 $image_atts
 
 $image_meta
 
 $link_atts = array()
 
if( $gravityview_view->getAtts('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] : ""
 
 $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 24 of file post_image.php.

Referenced by GravityView_Edit_Entry_Render\update_post_image().

◆ $caption

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

Definition at line 27 of file post_image.php.

Referenced by GravityView_Field_Post_Image\explode_value().

◆ $description

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

Definition at line 28 of file post_image.php.

Referenced by GravityView_Widget_Gravity_Forms\render_frontend().

◆ $gravityview_view

$gravityview_view = GravityView_View::getInstance()

Definition at line 9 of file post_image.php.

◆ $image

$image = new GravityView_Image( $image_atts )

◆ $image_atts

$image_atts
Initial value:
= array(
'src' => $url,
'alt' => ( !empty( $caption ) ? $caption : $title ),
'validate_src' => false,
)
$url
Definition: post_image.php:25
$caption
Definition: post_image.php:27
$title
Definition: post_image.php:26

Definition at line 92 of file post_image.php.

Referenced by GravityView_Plugin_Hooks_Gravity_Forms_Dropbox\filter_image_atts(), and GravityView_Field_FileUpload\get_files_array().

◆ $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'
),
))
$caption
Definition: post_image.php:27
$title
Definition: post_image.php:26
$description
Definition: post_image.php:28

Definition at line 106 of file post_image.php.

Referenced by GravityView_Edit_Entry_Render\update_post_image().

◆ $link_atts [1/3]

$link_atts = array()

Definition at line 30 of file post_image.php.

◆ $link_atts [2/3]

if ($gravityview_view->getAtts( 'lightbox')) $link_atts[ 'href'] = $href

Definition at line 83 of file post_image.php.

◆ $link_atts [3/3]

$link_atts[ 'title'] = $title

Definition at line 86 of file post_image.php.

◆ $output

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

Definition at line 138 of file post_image.php.

◆ $showlabels

$showlabels = apply_filters( 'gravityview_post_image_meta_show_labels', true )

Definition at line 135 of file post_image.php.

◆ $title

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

Definition at line 26 of file post_image.php.

◆ $url

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

◆ $wrappertag

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

Definition at line 128 of file post_image.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:
{
$url
Definition: post_image.php:25
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 70 of file post_image.php.