GravityView  2.1.1
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Attributes
Entry Class Reference

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

Inheritance diagram for Entry:
GF_Entry Multi_Entry

Public Member Functions

 as_entry ()
 Return the backing entry object. More...
 
 get_permalink (\GV\View $view=null, \GV\Request $request=null, $track_directory=true)
 Return the link to this entry in the supplied context. More...
 

Static Public Member Functions

static add_rewrite_endpoint ()
 Adds the necessary rewrites for single Entries. More...
 
static by_id ( $entry_id)
 Construct a instance by ID. More...
 
static get_endpoint_name ()
 Return the endpoint name for a single Entry. More...
 

Data Fields

 $ID = null
 

Static Public Attributes

static $backend = null
 

Protected Attributes

 $entry
 

Detailed Description

If this file is called directly, abort.

The base class.

Contains all entry data and some processing and logic rules.

Definition at line 14 of file class-gv-entry.php.

Member Function Documentation

◆ add_rewrite_endpoint()

static add_rewrite_endpoint ( )
static

Adds the necessary rewrites for single Entries.

Let's make sure the endpoint array is not polluted.

Definition at line 42 of file class-gv-entry.php.

◆ as_entry()

as_entry ( )

Return the backing entry object.

Returns
array The backing entry object.

Definition at line 91 of file class-gv-entry.php.

References $entry.

◆ by_id()

static by_id (   $entry_id)
static

Construct a instance by ID.

Parameters
int | string$entry_idThe internal entry ID.
Since
2.0
Returns
|null An instance of this entry or null if not found.

Definition at line 82 of file class-gv-entry.php.

◆ get_endpoint_name()

static get_endpoint_name ( )
static

Return the endpoint name for a single Entry.

Also used as the query_var for the time being.

Runs Filter:
gravityview_directory_endpoint Change the slug used for single entries
Parameters
[in,out]string$endpointSlug to use when accessing single entry. Default: entry

Definition at line 63 of file class-gv-entry.php.

Referenced by gravityview\callback(), GravityView_API\entry_link(), oEmbed\get_entry_regex(), Entry\get_permalink(), Views_Route\get_sub_item_permissions_check(), and GravityView_frontend\is_single_entry().

◆ get_permalink()

get_permalink ( \GV\View  $view = null,
\GV\Request  $request = null,
  $track_directory = true 
)

Return the link to this entry in the supplied context.

Since
2.0
Parameters
\GV\View | null$viewThe View context.
\GV\Request$requestThe Request (current if null).
boolean$track_directoryKeep the housing directory arguments intact (used for breadcrumbs, for example). Default: true.
Returns
string The permalink to this entry.

This is not a regular view.

Must be an embed of some sort.

Fallback to regular view base.

Runs Filter:
gravityview_directory_link Modify the URL to the View "directory" context
Since
1.19.4
Parameters
string$linkURL to the View's "directory" context (Multiple Entries screen)
int$post_idID of the post to link to. If the View is embedded, it is the post or page ID

Assemble the permalink.

Make sure the $directory_link doesn't contain any query otherwise it will break when adding the entry slug.

Since
1.16.5
Runs Filter:
gravityview/entry/permalink The permalink of this entry.
Since
2.0
Parameters
string$permalinkThe permalink.
\GV\Entry$entryThe entry we're retrieving it for.
\GV\View | null$viewThe view context.
\GV\Request$reqeustThe request context.

Definition at line 107 of file class-gv-entry.php.

References $entry_slug, $post, $view_id, Entry\get_endpoint_name(), GravityView_API\get_entry_slug(), and gravityview().

Field Documentation

◆ $backend

$backend = null
static

Definition at line 21 of file class-gv-entry.php.

◆ $entry

$entry
protected

Definition at line 34 of file class-gv-entry.php.

◆ $ID

$ID = null

Definition at line 29 of file class-gv-entry.php.


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