GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gv-template-entry-legacy.php
Go to the documentation of this file.
1 <?php
2 namespace GV;
3 
4 /** If this file is called directly, abort. */
5 if ( ! defined( 'GRAVITYVIEW_DIR' ) ) {
6  die();
7 }
8 
9 /**
10  * The Legacy Entry Template class .
11  *
12  * A back-compatibility layer for old templates to work.
13  */
15  /**
16  * Render an old template.
17  */
18  public function render() {
19  if ( ! class_exists( 'GravityView_Template' ) ) {
20  return;
21  }
22 
23  $entries = new \GV\Entry_Collection();
24  $entries->add( $this->entry );
25 
26  $context = array(
27  'view' => $this->view,
28  'fields' => $this->view->fields->by_visible( $this->view ),
29  'entries' => $entries,
30  'entry' => $this->entry,
31  'request' => $this->request,
32  );
33 
34  global $post;
35 
36  if ( $post ) {
37  $context['post'] = $post;
38  }
39 
41 
42  $sections = array( 'single' );
43 
44  $sections = apply_filters( 'gravityview_render_view_sections', $sections, $this->view->settings->get( 'template' ) );
45 
47 
48  $slug = apply_filters( 'gravityview_template_slug_' . $this->view->settings->get( 'template' ), 'table', 'directory' );
49 
50  foreach ( $sections as $section ) {
51  $template->render( $slug, $section, false );
52  }
53 
55  }
56 }
If this file is called directly, abort.
static getInstance( $passed_post=NULL)
if(! isset( $gravityview)||empty( $gravityview->template)) $template
The entry loop for the list output.
If this file is called directly, abort.
$entries
global $post
Definition: delete-entry.php:7
static pop()
Restores last saved state and context.
Definition: _mocks.php:410
static push( $configuration)
Set the state depending on the provided configuration.
Definition: _mocks.php:400
render()
Render an old template.
$entry
Definition: notes.php:27