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

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

Inheritance diagram for View:

Public Member Functions

 __construct ()
 The constructor. More...
 
 __get ( $key)
 
 as_data ()
 Be compatible with the old data object. More...
 
 offsetExists ( $offset)
 ArrayAccess compatibility layer with GravityView_View_Data::$views. More...
 
 offsetGet ( $offset)
 ArrayAccess compatibility layer with GravityView_View_Data::$views. More...
 
 offsetSet ( $offset, $value)
 ArrayAccess compatibility layer with GravityView_View_Data::$views. More...
 
 offsetUnset ( $offset)
 ArrayAccess compatibility layer with GravityView_View_Data::$views. More...
 

Static Public Member Functions

static by_id ( $post_id)
 Construct a instance from a post ID. More...
 
static exists ( $view)
 Determines if a view exists to begin with. More...
 
static from_post ( $post)
 Construct a instance from a . More...
 
static register_post_type ()
 Register the gravityview WordPress Custom Post Type. More...
 

Data Fields

 $fields
 
 $form
 
 $settings
 
 $template
 

Private Attributes

 $post
 

Detailed Description

If this file is called directly, abort.

The default GravityView View class.

Houses all base View functionality.

Can be accessed as an array for old compatibility's sake in line with the elements inside the ::$views array.

Definition at line 17 of file class-gv-view.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

The constructor.

Definition at line 60 of file class-gv-view.php.

Member Function Documentation

◆ __get()

__get (   $key)

Definition at line 410 of file class-gv-view.php.

◆ as_data()

as_data ( )

Be compatible with the old data object.

Some external code expects an array (doing things like foreach on this, or array_keys) so let's return an array in the old format for such cases. Do not use unless using for back-compatibility.

Definition at line 397 of file class-gv-view.php.

References gravityview_get_form().

◆ by_id()

static by_id (   $post_id)
static

Construct a instance from a post ID.

Parameters
int | string$post_idThe post ID.
Since
future
Returns
|null An instance around this or null if not found.

Definition at line 290 of file class-gv-view.php.

References $post.

Referenced by GravityView_Edit_Entry_Render\get_configured_edit_fields(), GravityView_View_Data\get_fields(), GravityView_View_Data\get_view(), and GV\Mocks\GravityView_View_Data_add_view().

◆ exists()

static exists (   $view)
static

Determines if a view exists to begin with.

Parameters
int | \WP_Post | null$view_idThe WordPress post ID, a object or null for global $post;
Since
future
Returns
bool Whether the post exists or not.

Definition at line 306 of file class-gv-view.php.

Referenced by GravityView_View_Data\maybe_get_view_id().

◆ from_post()

static from_post (   $post)
static

Construct a instance from a .

Parameters
$postThe instance to wrap.
Since
future
Returns
|null An instance around this if valid, null otherwise.

Get connected form.

Runs Filter:
gravityview/configuration/fields Filter the View fields' configuration array
Since
1.6.5
Parameters
$fieldsarray Multi-array of fields with first level being the field zones
$view_idint The View the fields are being pulled for

Get all fields.

The settings.

Set the template.

Deprecated:

The data here has been moved to various keys in a instance. As a compatibilty layer we allow array access over any instance with these keys.

This data is immutable (for now).

See also
::offsetGet() for internal mappings.
Deprecated:
See also
::$ID
Deprecated:
See also
::$ID
Deprecated:
See also
$form
Deprecated:
See also
::$form::$ID
Deprecated:
See also
::$settings
Deprecated:
See also
::$fields
Deprecated:
See also
::$template::$ID

Definition at line 186 of file class-gv-view.php.

References $post, gravityview(), gravityview_get_directory_widgets(), and gravityview_get_template_settings().

◆ offsetExists()

offsetExists (   $offset)

ArrayAccess compatibility layer with GravityView_View_Data::$views.

Definition at line 318 of file class-gv-view.php.

◆ offsetGet()

offsetGet (   $offset)

ArrayAccess compatibility layer with GravityView_View_Data::$views.

Maps the old keys to the new data;

Definition at line 334 of file class-gv-view.php.

References $form, and gravityview().

◆ offsetSet()

offsetSet (   $offset,
  $value 
)

ArrayAccess compatibility layer with GravityView_View_Data::$views.

Definition at line 369 of file class-gv-view.php.

References gravityview().

◆ offsetUnset()

offsetUnset (   $offset)

ArrayAccess compatibility layer with GravityView_View_Data::$views.

Definition at line 381 of file class-gv-view.php.

References gravityview().

◆ register_post_type()

static register_post_type ( )
static

Register the gravityview WordPress Custom Post Type.

Register only once

Runs Filter:
gravityview_is_hierarchical Make GravityView Views hierarchical by returning TRUE This will allow for Views to be nested with Parents and also allows for menu order to be set in the Page Attributes metabox
Since
1.13
Parameters
boolean$is_hierarchicalDefault: false
Runs Filter:
gravityview_post_type_supports Modify post type support values for gravityview post type
See also
add_post_type_support()
Since
1.15.2
Parameters
array$supportsArray of features associated with a functional area of the edit screen. Default: 'title', 'revisions'. If $is_hierarchical, also 'page-attributes'
[in]boolean$is_hierarchicalDo Views support parent/child relationships? See gravityview_is_hierarchical filter.

Register Custom Post Type - gravityview

Runs Filter:
gravityview_direct_access Should Views be directly accessible, or only visible using the shortcode?
See also
https://codex.wordpress.org/Function_Reference/register_post_type#public
Since
1.15.2
Parameters
[in,out]booleantrue: allow Views to be accessible directly. false: Only allow Views to be embedded via shortcode. Default: true
int$view_idThe ID of the View currently being requested. 0 for general setting
Runs Filter:
gravityview_has_archive Enable Custom Post Type archive?
Since
1.7.3
Parameters
booleanFalse: don't have frontend archive; True: yes, have archive. Default: false
Runs Filter:
gravityview_slug Modify the url part for a View.
See also
http://docs.gravityview.co/article/62-changing-the-view-slug
Parameters
string$slugThe slug shown in the URL
Runs Filter:
gravityview/post_type/with_front Should the permalink structure be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/view/, true->/blog/view/). Defaults to true.
See also
https://codex.wordpress.org/Function_Reference/register_post_type
Since
future
Parameters
bool$with_front

Definition at line 71 of file class-gv-view.php.

References $labels, gravityview(), and GravityView_Admin\no_views_text().

Field Documentation

◆ $fields

$fields

Definition at line 50 of file class-gv-view.php.

◆ $form

$form

Definition at line 40 of file class-gv-view.php.

◆ $post

$post
private

Definition at line 22 of file class-gv-view.php.

◆ $settings

$settings

Definition at line 30 of file class-gv-view.php.

◆ $template

$template

Definition at line 55 of file class-gv-view.php.


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