GravityView  1.22.6
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Static Public Member Functions
View_Collection Class Reference

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

Inheritance diagram for View_Collection:
Collection

Public Member Functions

 add ( $view)
 Add a to this collection. More...
 
 contains ( $view_id)
 Check whether with an ID is already here. More...
 
 get ( $view_id)
 Get a from this list. More...
 
- Public Member Functions inherited from Collection
 add ( $value)
 Add an object to this collection. More...
 
 all ()
 Returns all the objects in this collection as an an array. More...
 
 clear ()
 Clear this collection. More...
 
 count ()
 Returns the count of the objects in this collection. More...
 
 last ()
 Get the last added object. More...
 
 merge (\GV\Collection $collection)
 Merge another collection into here. More...
 

Static Public Member Functions

static from_content ( $content)
 Get a list of detected objects inside the supplied content. More...
 
static from_post (\WP_Post $post)
 Get a list of objects inside the supplied . More...
 

Detailed Description

If this file is called directly, abort.

A collection of objects.

Definition at line 12 of file class-gv-collection-view.php.

Member Function Documentation

◆ add()

add (   $view)

Add a to this collection.

Parameters
\GV\View$viewThe view to add to the internal array.
Since
future
Returns
void

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

References gravityview().

◆ contains()

contains (   $view_id)

Check whether with an ID is already here.

Parameters
int$view_idThe ID of the view to check.
Since
future
Returns
boolean Whether it exists or not.

Definition at line 61 of file class-gv-collection-view.php.

References $view_id.

◆ from_content()

static from_content (   $content)
static

Get a list of detected objects inside the supplied content.

The content can have a shortcode, this is the simplest case.

Parameters
string$contentThe content to look into.
Since
future
Returns
A instance containing the views inside the supplied .

Let's find us some [gravityview] shortcodes perhaps.

Definition at line 128 of file class-gv-collection-view.php.

References $content.

◆ from_post()

static from_post ( \WP_Post  $post)
static

Get a list of objects inside the supplied .

The post can be a gravityview post, which is the simplest case. The post can contain gravityview shortcodes as well. The post meta can contain gravityview shortcodes.

Parameters
\WP_Post$postThe object to look into.
Since
future
Returns
A instance contanining the views inside the supplied .

A straight up gravityview post.

Runs Filter:
gravityview/view_collection/from_post/meta_keys Define meta keys to parse to check for GravityView shortcode content.

This is useful when using themes that store content that may contain shortcodes in custom post meta.

Since
future
Parameters
[in,out]array$meta_keysArray of key values to check. If empty, do not check. Default: empty array
[in]\WP_Post$postThe post that is being checked
Runs Filter:
gravityview/data/parse/meta_keys
Deprecated:
See also
The gravityview/view_collection/from_post/meta_keys filter.

What about inside post meta values?

Definition at line 78 of file class-gv-collection-view.php.

Referenced by GravityView_View_Data\is_valid_embed_id(), GravityView_View_Data\maybe_get_view_id(), and GravityView_oEmbed\set_vars().

◆ get()

get (   $view_id)

Get a from this list.

Parameters
int$view_idThe ID of the view to get.
Since
future
Returns
|null The with the $view_id as the ID, or null if not found.

Definition at line 42 of file class-gv-collection-view.php.

References $view_id.


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