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

Register oEmbed handlers for embedding GravityView data and render that data. More...

Public Member Functions

 get_entry_id ()
 Get the entry id for the current oEmbedded entry. More...
 
 register_handler ()
 Register the oEmbed handler. More...
 
 render_handler ($matches, $attr, $url, $rawattr)
 
 set_single_entry_id ($is_single_entry=false)
 Tell get_gravityview() to display a single entry. More...
 

Static Public Member Functions

static getInstance ()
 

Static Public Attributes

static $instance = NULL
 

Protected Attributes

 $entry_id = NULL
 Set entry_id and view_id from the data sent to render_handler. More...
 
 $is_full_oembed_preview = false
 
 $output = array()
 
 $view_id = NULL
 

Private Member Functions

 __construct ()
 
 generate_entry_output ()
 
 generate_preview_notice ()
 Generate a warning to users when previewing oEmbed in the Add Media modal. More...
 
 get_handler_regex ()
 Generate the Regular expression that matches embedded entries. More...
 
 get_postid_from_url_and_slug ($url= '', $slug= '')
 Get the post ID from an URL. More...
 
 initialize ()
 
 render_admin ($matches, $attr, $url, $rawattr)
 Display a nice placeholder in the admin for the entry. More...
 
 set_vars ($matches, $attr, $url, $rawattr)
 

Detailed Description

Register oEmbed handlers for embedding GravityView data and render that data.

Since
1.6

Definition at line 22 of file class-oembed.php.

Constructor & Destructor Documentation

__construct ( )
private

Definition at line 31 of file class-oembed.php.

Member Function Documentation

generate_entry_output ( )
private

Definition at line 273 of file class-oembed.php.

References the_gravityview().

Referenced by set_single_entry_id().

generate_preview_notice ( )
private

Generate a warning to users when previewing oEmbed in the Add Media modal.

Returns
string HTML notice

Definition at line 205 of file class-oembed.php.

References $title, and GravityView_Admin\get_floaty().

Referenced by render_handler().

get_entry_id ( )

Get the entry id for the current oEmbedded entry.

Since
1.6
Returns
int|null

Definition at line 146 of file class-oembed.php.

References $entry_id.

get_handler_regex ( )
private

Generate the Regular expression that matches embedded entries.

Generates different regex if using permalinks and if not using permalinks

Since
1.6
Returns
string Regex code

Deprecated. Use ::get_endpoint_name instead.

Runs Filter:
gravityview_slug Modify the url part for a View. Read the doc
Parameters
string$rewrite_slugThe slug shown in the URL

Definition at line 75 of file class-oembed.php.

References Entry\get_endpoint_name(), and GravityView_Post_Types\get_entry_var_name().

Referenced by register_handler().

get_postid_from_url_and_slug (   $url = '',
  $slug = '' 
)
private

Get the post ID from an URL.

This is necessary because url_to_postid() doesn't work with permalinks off for custom post types

url_to_postid()

Since
1.6
Parameters
string$urlURL to get the post ID from
string$slugThe name of a post, used as backup way of checking for post ID
Returns
int 0 if not found; int of URL post ID otherwise

Definition at line 117 of file class-oembed.php.

References $url.

Referenced by set_vars().

static getInstance ( )
static
initialize ( )
private

Definition at line 33 of file class-oembed.php.

register_handler ( )

Register the oEmbed handler.

Since
1.6 get_handler_regex

Definition at line 60 of file class-oembed.php.

References get_handler_regex().

render_admin (   $matches,
  $attr,
  $url,
  $rawattr 
)
private

Display a nice placeholder in the admin for the entry.

Parameters
array$matchesThe regex matches from the provided regex when calling wp_embed_register_handler()
array$attrEmbed attributes.
string$urlThe original URL that was matched by the regex.
array$rawattrThe original unmodified attributes.
Returns
string The embed HTML.

Definition at line 252 of file class-oembed.php.

References $image, and GravityView_Admin\get_floaty().

Referenced by render_handler().

render_handler (   $matches,
  $attr,
  $url,
  $rawattr 
)
Since
1.6
See also
GravityView_oEmbed::add_providers() for the regex
Parameters
array$matchesThe regex matches from the provided regex when calling wp_embed_register_handler()
array$attrEmbed attributes.
string$urlThe original URL that was matched by the regex.
array$rawattrThe original unmodified attributes.
Returns
string The embed HTML.

Definition at line 162 of file class-oembed.php.

References $url, generate_preview_notice(), render_admin(), and set_vars().

set_single_entry_id (   $is_single_entry = false)

Tell get_gravityview() to display a single entry.

REQUIRED FOR THE VIEW TO OUTPUT A SINGLE ENTRY

Parameters
bool | int$is_single_entryExisting single entry. False, because GV thinks we're in a post or page.
Returns
int The current entry ID

Definition at line 304 of file class-oembed.php.

References $entry_id, $output, $url, generate_entry_output(), and getInstance().

set_vars (   $matches,
  $attr,
  $url,
  $rawattr 
)
private

Field Documentation

$entry_id = NULL
protected

Set entry_id and view_id from the data sent to render_handler.

Definition at line 25 of file class-oembed.php.

Referenced by get_entry_id(), and set_single_entry_id().

$instance = NULL
static

Definition at line 29 of file class-oembed.php.

$is_full_oembed_preview = false
protected

Definition at line 27 of file class-oembed.php.

$output = array()
protected

Definition at line 24 of file class-oembed.php.

Referenced by set_single_entry_id().

$view_id = NULL
protected
See also
render_handler

Definition at line 26 of file class-oembed.php.


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