GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
field-post_tags-html.php
Go to the documentation of this file.
1 <?php
2 /**
3  * The default post_content field output template.
4  *
5  * @global \GV\Template_Context $gravityview
6  * @since 2.0
7  */
8 
9 if ( ! isset( $gravityview ) || empty( $gravityview->template ) ) {
10  gravityview()->log->error( '{file} template loaded without context', array( 'file' => __FILE__ ) );
11  return;
12 }
13 
14 $display_value = $gravityview->display_value;
15 $entry = $gravityview->entry->as_entry();
16 $field_settings = $gravityview->field->as_configuration();
17 
18 if ( ! empty( $field_settings['dynamic_data'] ) && ! empty( $entry['post_id'] ) ) {
19 
20  $term_list = gravityview_get_the_term_list( $entry['post_id'], $field_settings['link_to_term'] );
21 
22  if ( empty( $term_list ) ) {
23  do_action( 'gravityview_log_debug', 'Dynamic data for post #' . $entry['post_id'] . ' doesnt exist.' );
24  }
25 
26  echo $term_list;
27 
28 } else {
29 
30  if ( empty( $field_settings['link_to_term'] ) ) {
31 
32  echo esc_html( $display_value );
33 
34  } else {
35 
37  }
38 }
gravityview_get_the_term_list( $post_id, $link=true, $taxonomy='post_tag')
Get the links for post_tags and post_category output based on post ID.
Definition: class-api.php:1115
$entry
if(! isset( $gravityview)||empty( $gravityview->template)) $display_value
The default post_content field output template.
gravityview_convert_value_to_term_list( $value, $taxonomy='post_tag')
Take a passed CSV of terms and generate a linked list of terms.
Definition: class-api.php:1060
gravityview()
The main GravityView wrapper function.
$field_settings