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
Request Class Reference

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

Inheritance diagram for Request:
Admin_Request Frontend_Request Mock_Request Request

Public Member Functions

 __construct ()
 
 is_edit_entry ( $form_id=0)
 Checks whether this an edit entry request. More...
 
 is_entry ( $form_id=0)
 Checks whether this is a single entry request. More...
 
 is_renderable ()
 Whether this request is something that is renderable. More...
 
 is_search ()
 Checks whether this an entry search request. More...
 
 is_view ( $return_view=true)
 The current $post is a View, no? More...
 

Static Public Member Functions

static is_add_oembed_preview ()
 Is this the Add Media / From URL preview request? More...
 
static is_admin ()
 Check if WordPress is_admin(), and make sure not DOING_AJAX. More...
 
static is_ajax ()
 Is this an AJAX call in progress? More...
 
static is_frontend ()
 This is the frontend. More...
 
static is_rest ()
 Is this a REST request? Call after parse_request. More...
 

Private Member Functions

 _has_field_key ( $get)
 Calculate whether the $_REQUEST has a GravityView field. More...
 

Detailed Description

If this file is called directly, abort.

The Request abstract class.

Knows more about the request than anyone else.

Definition at line 14 of file class-gv-request.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Definition at line 16 of file class-gv-request.php.

Member Function Documentation

◆ _has_field_key()

_has_field_key (   $get)
private

Calculate whether the $_REQUEST has a GravityView field.

Definition at line 264 of file class-gv-request.php.

References $field, $value, GravityView_Fields\get_all(), and gravityview().

◆ is_add_oembed_preview()

static is_add_oembed_preview ( )
static

Is this the Add Media / From URL preview request?

Will not work in WordPress 4.8+

Returns
boolean

The preview request is a parse-embed AJAX call without a type set.

Definition at line 70 of file class-gv-request.php.

◆ is_admin()

static is_admin ( )
static

Check if WordPress is_admin(), and make sure not DOING_AJAX.

Returns
boolean

Definition at line 47 of file class-gv-request.php.

◆ is_ajax()

static is_ajax ( )
static

Is this an AJAX call in progress?

Returns
boolean

Definition at line 80 of file class-gv-request.php.

◆ is_edit_entry()

is_edit_entry (   $form_id = 0)

Checks whether this an edit entry request.

Since
2.0
Parameters
int$form_idThe form ID, since slugs can be non-unique. Default: 0.
Returns
|false The entry requested or false.
Runs Filter:
gravityview_is_edit_entry Whether we're currently on the Edit Entry screen
The Edit Entry functionality overrides this value.
Parameters
boolean$is_edit_entry

Definition at line 206 of file class-gv-request.php.

References $entry, and $form_id.

◆ is_entry()

is_entry (   $form_id = 0)

Checks whether this is a single entry request.

Since
2.0
Parameters
int$form_idThe form ID, since slugs can be non-unique. Default: 0.
Returns
|false The entry requested or false.

Not CPT, so probably a shortcode

A joined request.

A regular one.

Definition at line 123 of file class-gv-request.php.

References $entries, $entry, $form_id, $forms, GV\$i, Utils\get(), and gravityview().

◆ is_frontend()

static is_frontend ( )
static

This is the frontend.

Returns
boolean True or false.

Definition at line 59 of file class-gv-request.php.

◆ is_renderable()

is_renderable ( )

Whether this request is something that is renderable.

Since
2.5.2
Returns
bool Yes or no.
Runs Filter:
gravityview/request/is_renderable Is this request renderable?
Since
2.5.2
Parameters
boolean$is_renderableHuh?
\GV\Request$thisThis.

Definition at line 25 of file class-gv-request.php.

◆ is_rest()

static is_rest ( )
static

Is this a REST request? Call after parse_request.

Returns
boolean

Definition at line 89 of file class-gv-request.php.

◆ is_search()

is_search ( )

Checks whether this an entry search request.

Since
2.0
Returns
boolean True if this is a search request.

Definition at line 231 of file class-gv-request.php.

References $search_method.

◆ is_view()

is_view (   $return_view = true)

The current $post is a View, no?

Since
2.0
2.16 Added $return_view parameter.
Parameters
bool$return_viewWhether to return a View object or boolean.
Returns
|bool If the global $post is a View, returns the View or true, depending on $return_view. If not a View, returns false.

Definition at line 104 of file class-gv-request.php.

References $post, and View\from_post().

Referenced by GravityView_Welcome\getting_started_screen().


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