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

Handle the [gravityview] shortcode. More...

Public Member Functions

 __construct ()
 

Static Public Member Functions

 shortcode ( $passed_atts, $content=null)
 Callback function for add_shortcode() More...
 

Private Member Functions

 add_hooks ()
 
 get_view_detail ( $detail='')
 Display details for the current View. More...
 
 parse_and_sanitize_atts ( $passed_atts)
 Validate attributes passed to the [gravityview] shortcode. More...
 

Detailed Description

Handle the [gravityview] shortcode.

Since
1.13
See also

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

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Definition at line 23 of file class-gravityview-shortcode.php.

References add_hooks().

Member Function Documentation

◆ add_hooks()

add_hooks ( )
private

Definition at line 27 of file class-gravityview-shortcode.php.

Referenced by __construct().

◆ get_view_detail()

get_view_detail (   $detail = '')
private

Display details for the current View.

Since
1.13
Parameters
string$detailThe information requested about the current View. Accepts total_entries, first_entry (entry #), last_entry (entry #), and page_size
Returns
string Detail information
Runs Filter:
gravityview/shortcode/detail/{$detail} Filter the detail output returned from [gravityview detail="$detail"]
Since
1.13
Parameters
string$returnExisting output

Definition at line 151 of file class-gravityview-shortcode.php.

References $gravityview_view, and GravityView_View\getInstance().

Referenced by shortcode().

◆ 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)

Since
1.15.1
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
Since
2.1

Only allow values that are defined in the settings

Definition at line 77 of file class-gravityview-shortcode.php.

References View_Settings\defaults(), gv_empty(), and GravityView_Merge_Tags\replace_variables().

Referenced by shortcode().

◆ shortcode()

shortcode (   $passed_atts,
  $content = null 
)
static

Callback function for add_shortcode()

Since
1.13
Parameters
mixed$passed_atts
string | null$contentContent passed inside the shortcode
Returns
null|string If admin, null. Otherwise, output of $this->render_view()

Definition at line 40 of file class-gravityview-shortcode.php.

References get_view_detail(), GravityView_frontend\getInstance(), gravityview(), and parse_and_sanitize_atts().


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