GravityView_Ajax
Source: includes/class-ajax.php:5
Details
- Kind:
class - Namespace:
(global)
Methods
| Method | Description |
|---|---|
check_ajax_nonce() | Verify the nonce. Exit if not verified. |
get_available_fields_html() | AJAX action to get HTML markup for form(s) or template fields |
get_active_areas() | Returns template active areas given a template ID |
create_row() | Returns the HTML for a new grid row. |
get_preset_fields_config() | Fill in active areas with preset configuration according to the template selected |
create_preset_form() | Create the preset form requested before the View save |
import_form() | Import Gravity Form XML or JSON |
get_field_options() | Returns field options - called by ajax when dropping fields into active areas |
get_sortable_fields() | Given a View id, calculates the assigned form, and returns the form fields (only the sortable ones ) |
pre_get_form_fields() | Get the form fields for a preset (no form created yet) |
import_fields() | Import fields configuration from an exported WordPress View preset |
Method Reference
check_ajax_nonce()
function check_ajax_nonce()
Verify the nonce. Exit if not verified.
Returns
void
Source: includes/class-ajax.php:58
get_available_fields_html()
function get_available_fields_html()
AJAX action to get HTML markup for form(s) or template fields
AJAX callback
Returns
array|void— Terminate request, exit with JSON response or return HTML markup
Source: includes/class-ajax.php:70
get_active_areas()
function get_active_areas()
Returns template active areas given a template ID
AJAX callback
Returns
void
Source: includes/class-ajax.php:119
create_row()
public function create_row()
Returns the HTML for a new grid row.
Since: 2.31.0
Source: includes/class-ajax.php:158
get_preset_fields_config()
function get_preset_fields_config()
Fill in active areas with preset configuration according to the template selected
Returns
void
Source: includes/class-ajax.php:199
create_preset_form()
function create_preset_form()
Create the preset form requested before the View save
Returns
void
Source: includes/class-ajax.php:283
import_form()
function import_form( $xml_or_json_path='' )
Import Gravity Form XML or JSON
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$xml_or_json_path | string | '' | Path to form XML or JSON file |
Returns
int|bool— Imported form ID or false
Source: includes/class-ajax.php:318
get_field_options()
function get_field_options()
Returns field options - called by ajax when dropping fields into active areas
AJAX callback
Returns
void
Source: includes/class-ajax.php:356
get_sortable_fields()
function get_sortable_fields()
Given a View id, calculates the assigned form, and returns the form fields (only the sortable ones )
AJAX callback
Returns
void
Source: includes/class-ajax.php:399
pre_get_form_fields()
static function pre_get_form_fields( $template_id='' )
Get the form fields for a preset (no form created yet)
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$template_id | string | '' | Preset template |
Returns
array|false
Source: includes/class-ajax.php:426
import_fields()
function import_fields( $file )
Import fields configuration from an exported WordPress View preset
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$file | string | path to file |
Returns
array— Fields config array (unserialized)
Source: includes/class-ajax.php:478