GV\Request
The Request abstract class.
Knows more about the request than anyone else.
Source: future/includes/class-gv-request.php:14
Details
- Kind:
class - Namespace:
GV
Methods
| Method | Description |
|---|---|
is_renderable() | Whether this request is something that is renderable. |
is_admin() | Check if WordPress is_admin(), and make sure not DOING_AJAX. |
is_frontend() | This is the frontend. |
is_add_oembed_preview() | Is this the Add Media / From URL preview request? |
is_ajax() | Is this an AJAX call in progress? |
is_rest() | Is this a REST request? Call after parse_request. |
is_view() | The current $post is a View, no? |
is_entry() | Checks whether this is a single entry request |
is_edit_entry() | Checks whether this an edit entry request. |
is_search() | Checks whether this an entry search request. |
Method Reference
is_renderable()
public function is_renderable()
Whether this request is something that is renderable.
Returns
bool— Yes or no.
Since: 2.5.2
Source: future/includes/class-gv-request.php:25
is_admin()
public static function is_admin()
Check if WordPress is_admin(), and make sure not DOING_AJAX.
Returns
boolean
Source: future/includes/class-gv-request.php:53
is_frontend()
public static function is_frontend()
This is the frontend.
Returns
boolean— True or false.
Source: future/includes/class-gv-request.php:65
is_add_oembed_preview()
public static function is_add_oembed_preview()
Is this the Add Media / From URL preview request?
Will not work in WordPress 4.8+
Returns
boolean
Source: future/includes/class-gv-request.php:76
is_ajax()
public static function is_ajax()
Is this an AJAX call in progress?
Returns
boolean
Source: future/includes/class-gv-request.php:86
is_rest()
public static function is_rest()
Is this a REST request? Call after parse_request.
Returns
boolean
Source: future/includes/class-gv-request.php:95
is_view()
public function is_view( $return_view=true )
The current $post is a View, no?
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$return_view | bool | true | Whether to return a View object or boolean. |
Returns
- \GV\View |
bool— If the global $post is a View, returns the View or true, depending on $return_view. If not a View, returns false.
Since:
Source: future/includes/class-gv-request.php:110
is_entry()
public function is_entry( $form_id=0 )
Checks whether this is a single entry request
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | 0 | The form ID, since slugs can be non-unique. Default: 0. |
Returns
- \GV\GF_Entry |
false— The entry requested or false.
Since: 2.0
Source: future/includes/class-gv-request.php:129
is_edit_entry()
public function is_edit_entry( $form_id=0 )
Checks whether this an edit entry request.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | 0 | The form ID, since slugs can be non-unique. Default: 0. |
Returns
- \GV\Entry |
false— The entry requested or false.
Since: 2.0
Source: future/includes/class-gv-request.php:218
is_search()
public function is_search()
Checks whether this an entry search request.
Returns
boolean— True if this is a search request.
Since: 2.0
Source: future/includes/class-gv-request.php:250