GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
field-other_entries-html.php
Go to the documentation of this file.
1 <?php
2 /**
3  * The default field output template displaying
4  * entries created by same author.
5  *
6  * @global \GV\Template_Context $gravityview
7  * @since 2.0
8  */
9 
10 if ( ! isset( $gravityview ) || empty( $gravityview->template ) ) {
11  gravityview()->log->error( '{file} template loaded without context', array( 'file' => __FILE__ ) );
12  return;
13 }
14 
15 $created_by = \GV\Utils::get( $gravityview->entry, 'created_by' );
16 
17 /** There was no logged in user who created this entry. */
18 if ( empty( $created_by ) ) {
19  return;
20 }
21 
22 $entries = $gravityview->field->field->get_entries( $gravityview );
23 
24 /** Don't show if no entries and the setting says so. */
25 if ( empty( $entries ) ) {
26  if ( $gravityview->field->no_entries_hide ) {
27  return;
28  }
29 
30  if ( $gravityview->field->no_entries_text ) {
31  echo '<div class="gv-no-results"><p>' . esc_html( $gravityview->field->no_entries_text );
32  echo "</p>\n</div>";
33  return;
34  }
35 }
36 
37 /** If there are search results, get the entry list object. */
39  array_map( function( $entry ) { return $entry->as_entry(); }, $entries ),
40  $gravityview->request->is_view( false ) ? $gravityview->view->ID : ( is_object( $GLOBALS['post'] ) ? $GLOBALS['post']->ID : 0 ),
41  $gravityview->view->form->form,
42  $gravityview->field->link_format,
43  $gravityview->field->after_link,
44  'other_entries', // Context
45  $gravityview
46 );
47 
48 /** Generate and echo the output. */
49 $list->output();
50 
51 /**
52  * @since 1.7.6
53  * @deprecated since 1.11
54  */
55 $deprecated = apply_filters( 'gravityview/field/other_entries/args', array(), null );
56 if ( ! empty( $deprecated ) ) {
57  _deprecated_function( 'The "gravityview/field/other_entries/args" filter', 'GravityView 1.11', 'gravityview/field/other_entries/criteria' );
58 }
If this file is called directly, abort.
if(! isset( $gravityview)||empty( $gravityview->template)) $created_by
The default field output template displaying entries created by same author.
if(empty( $created_by)) $entries
There was no logged in user who created this entry.
if(empty( $entries)) $list
Don&#39;t show if no entries and the setting says so.
static get( $array, $key, $default=null)
Grab a value from an array or an object or default.
gravityview()
The main GravityView wrapper function.
$entry
Definition: notes.php:27