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

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

Inheritance diagram for gravityview:
Shortcode

Public Member Functions

 callback ( $passed_atts, $content='', $tag='')
 Process and output the [gravityview] shortcode. More...
 
- Public Member Functions inherited from Shortcode
 callback ( $atts, $content='', $tag='')
 The WordPress Shortcode API callback for this shortcode. More...
 

Data Fields

 $name = 'gravityview'
 
- Data Fields inherited from Shortcode
 $atts
 
 $content
 
 $name
 

Static Public Attributes

static $callstack = array()
 A stack of calls to track nested shortcodes. More...
 

Private Member Functions

 detail ( $view, $entries, $atts)
 Output view details. More...
 
 parse_and_sanitize_atts ( $passed_atts)
 Validate attributes passed to the [gravityview] shortcode. More...
 

Static Private Member Functions

static _return ( $value)
 Pop the callstack and return the value. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Shortcode
static add ( $name=null)
 Register this shortcode class with the WordPress Shortcode API. More...
 
static parse ( $content)
 Parse a string of content and figure out which ones there are. More...
 
static remove ()
 Unregister this shortcode. More...
 

Detailed Description

If this file is called directly, abort.

The [gravityview] shortcode.

Definition at line 12 of file class-gv-shortcode-gravityview.php.

Member Function Documentation

◆ _return()

static _return (   $value)
staticprivate

Pop the callstack and return the value.

Definition at line 361 of file class-gv-shortcode-gravityview.php.

References $value.

◆ callback()

callback (   $passed_atts,
  $content = '',
  $tag = '' 
)

Process and output the [gravityview] shortcode.

Parameters
array$passed_attsThe attributes passed.
string$contentThe content inside the shortcode.
string$tagThe shortcode tag.
Returns
string|null The output.
Runs Actions:
gravityview/shortcode/before-processing Runs before the GV shortcode is processed; can be used to load additional scripts/styles
Since
2.13.4
Parameters
\GV\View$viewGV View
\WP_Post$postAssociated WP post

When this shortcode is embedded inside a View we can only display it as a directory. There's no other way. Try to detect that we're not embedded to allow edit and single contexts.

Remove Widgets on a nested embedded View.

Check permissions.

This View has no data source. There's nothing to show really. ...apart from a nice message if the user can do anything about it.

View details.

Editing a single entry.

When editing an entry don't render multiple views.

Viewing a single entry.

When viewing an entry don't render multiple views.

Just this view.

Definition at line 32 of file class-gv-shortcode-gravityview.php.

References Shortcode\$atts, $entries, $entry, $post, $view_id, Utils\_GET(), View\by_id(), GVCommon\check_entry_display(), gravityview\detail(), Entry\get_endpoint_name(), GravityView_View_Data\getInstance(), gravityview(), GVCommon\has_cap(), GravityView_Entry_Approval_Status\is_approved(), GravityView_Entry_Approval\meta_key, and gravityview\parse_and_sanitize_atts().

◆ detail()

detail (   $view,
  $entries,
  $atts 
)
private

Output view details.

Parameters
\GV\View$viewThe View.
\GV\Entry_Collection$entriesThe calculated entries.
array$attsThe shortcode attributes (with defaults).
Returns
string The output.
Runs Filter:
gravityview/shortcode/detail/{$detail} Filter the detail output returned from [gravityview detail="$detail"]
Since
1.13
Parameters
string[in,out]$output Existing output
Since
2.0.3
Parameters
\GV\View$viewThe view.
\GV\Entry_Collection$entriesThe entries.
array$attsThe shortcode atts with defaults.

Definition at line 325 of file class-gv-shortcode-gravityview.php.

References Shortcode\$atts, $entries, $output, and endswitch.

Referenced by gravityview\callback().

◆ parse_and_sanitize_atts()

parse_and_sanitize_atts (   $passed_atts)
private

Validate attributes passed to the [gravityview] shortcode.

Supports {get} Merge Tags values.

Attributes passed to the shortcode are compared to registered attributes {

See also
::defaults} Only attributes that are defined will be allowed through.

Then, {get} merge tags are replaced with their $_GET values, if passed

Then, attributes are sanitized based on the type of setting (number, checkbox, select, radio, text)

See also
::defaults() Only attributes defined in default() are valid to be passed via the shortcode
Parameters
array$passed_attsAttribute pairs defined to render the View
Returns
array Valid and sanitized attribute pairs

Make sure number fields are numeric. Also, convert mixed number strings to numbers

See also
http://php.net/manual/en/function.is-numeric.php#107326

Only allow values that are defined in the settings

Definition at line 256 of file class-gv-shortcode-gravityview.php.

References Shortcode\$atts, View_Settings\defaults(), Utils\get(), gv_empty(), and GravityView_Merge_Tags\replace_variables().

Referenced by gravityview\callback().

Field Documentation

◆ $callstack

$callstack = array()
static

A stack of calls to track nested shortcodes.

Definition at line 21 of file class-gv-shortcode-gravityview.php.

◆ $name

$name = 'gravityview'

Definition at line 16 of file class-gv-shortcode-gravityview.php.


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