GravityView  1.19.4
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

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

Constructor & Destructor Documentation

__construct ( )

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

References add_hooks().

Member Function Documentation

add_hooks ( )
private

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

Referenced by __construct().

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 146 of file class-gravityview-shortcode.php.

References $gravityview_view, and GravityView_View\getInstance().

Referenced by shortcode().

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
GravityView_View_Data::get_default_args} 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
GravityView_View_Data::get_default_args Only attributes defined in get_default_args() 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 79 of file class-gravityview-shortcode.php.

References GravityView_View_Data\get_default_args(), gv_empty(), and GravityView_Merge_Tags\replace_variables().

Referenced by shortcode().

shortcode (   $passed_atts,
  $content = null 
)
static

Callback function for add_shortcode()

Since
1.13

public

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 42 of file class-gravityview-shortcode.php.

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


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