GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Protected Attributes | Private Attributes
Legacy_Override_Template Class Reference

If this file is called directly, abort. More...

Inheritance diagram for Legacy_Override_Template:

Public Member Functions

 __construct (\GV\View $view, \GV\Entry $entry=null, \GV\Field $field=null, \GV\Request $request=null)
 Catch deprecated template loads. More...
 
 __destruct ()
 
 add_id_specific_templates ( $templates, $slug, $name)
 Enable overrides of GravityView templates on a granular basis. More...
 
 locate_template ( $template_names, $load=false, $require_once=false)
 
 render ( $slug)
 Setup legacy rendering. More...
 

Protected Attributes

 $filter_prefix = 'gravityview'
 
 $theme_template_directory = 'gravityview'
 

Private Attributes

 $entry
 
 $view
 

Detailed Description

If this file is called directly, abort.

Load up the Gamajo Template Loader.

See also
https://github.com/GaryJones/Gamajo-Template-Loader Loads legacy override templates from the theme.

Makes sure they work by setting up context, etc.

Definition at line 23 of file class-gv-template-legacy-override.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \GV\View  $view,
\GV\Entry  $entry = null,
\GV\Field  $field = null,
\GV\Request  $request = null 
)

Catch deprecated template loads.

Parameters
\GV\View$viewThe View.
\GV\Entry$entryThe Entry.
\GV\Field$fieldThe Field.
\GV\Request$requestThe request.
Returns
void

Definition at line 56 of file class-gv-template-legacy-override.php.

References $entry, and gravityview().

◆ __destruct()

__destruct ( )

Definition at line 66 of file class-gv-template-legacy-override.php.

Member Function Documentation

◆ add_id_specific_templates()

add_id_specific_templates (   $templates,
  $slug,
  $name 
)

Enable overrides of GravityView templates on a granular basis.

The loading order is:

  • view-[View ID]-table-footer.php
  • form-[Form ID]-table-footer.php
  • page-[ID of post or page where view is embedded]-table-footer.php
  • table-footer.php
See also
Gamajo_Template_Loader::get_template_file_names() Where the filter is
Parameters
array$templatesExisting list of templates.
string$slugName of the template base, example: table, list, datatables, map
string$nameName of the template part, example: body, footer, head, single
Returns
array $templates Modified template array, merged with existing $templates values

Definition at line 96 of file class-gv-template-legacy-override.php.

References $name, $post, and $templates.

◆ locate_template()

locate_template (   $template_names,
  $load = false,
  $require_once = false 
)

See also
Gamajo_Template_Loader::locate_template()
Returns
null|string NULL: Template not found; String: path to template

Definition at line 75 of file class-gv-template-legacy-override.php.

◆ render()

render (   $slug)

Setup legacy rendering.

Parameters
string$slugThe slug.
Returns
string The output.

You got one shot. One opportunity. To render all the widgets you have ever wanted.

Since we're overriding the singleton we need to remove the widget actions since they can only be called once in a request (did_action/do_action mutex).

Oh, and Mom's spaghetti.

Single entry view.

Directory view.

Remove multiple sorting before calling legacy filters. This allows us to fake it till we make it.

Definition at line 125 of file class-gv-template-legacy-override.php.

References $entries, $entry, $post, GravityView_View\getInstance(), and Legacy_Context\push().

Field Documentation

◆ $entry

$entry
private

Definition at line 44 of file class-gv-template-legacy-override.php.

◆ $filter_prefix

$filter_prefix = 'gravityview'
protected

Definition at line 28 of file class-gv-template-legacy-override.php.

◆ $theme_template_directory

$theme_template_directory = 'gravityview'
protected

Definition at line 34 of file class-gv-template-legacy-override.php.

◆ $view

$view
private

Definition at line 39 of file class-gv-template-legacy-override.php.


The documentation for this class was generated from the following file: