GravityView_Admin_Views
Source: includes/class-admin-views.php:27
Details
- Kind:
class - Namespace:
(global)
Methods
| Method | Description |
|---|---|
get_instance() | Returns the singleton. |
disable_views_overview_notices() | Disables all notices and footer text on the Views overview page. |
is_views_overview_page() | Checks if the current page is the Views overview page. |
suggest_support_articles() | When on the Add/Edit View screen, suggest most popular articles related to that |
filter_pre_get_posts() | |
add_view_dropdown() | Adds dropdown selects to filter Views by connected form and layout |
render_setting_row() | |
render_field_option() | |
gform_toolbar_menu() | Add a GravityView menu to the Form Toolbar with connected views |
default_field_blocklist() | List the field types without presentation properties (on a View context) |
default_field_blacklist() | |
tooltips() | Add tooltip text for use throughout the UI |
add_custom_column_content() | Add the Data Source information |
get_connected_form_links() | Get HTML links relating to a connected form, like Edit, Entries, Settings, Preview |
add_post_type_columns() | Add the Data Source column to the Views page |
save_postdata() | Save View configuration |
render_label() | |
render_available_fields() | Render html for displaying available fields based on a Form ID |
render_additional_fields() | Render html for displaying additional fields based on a Form ID |
get_entry_default_fields() | Retrieve the default fields id, label and type |
get_available_fields() | Calculate the available fields |
render_available_widgets() | Render html for displaying available widgets |
get_registered_widgets() | Get the list of registered widgets. Each item is used to instantiate a GravityView_Admin_View_Widget object |
render_active_areas() | Generic function to render rows and columns of active areas for widgets & fields |
render_actions() | Renders the row actions. |
render_widgets_active_areas() | Render the widget active areas |
render_field_pickers() | Renders "Add Field" tooltips |
render_directory_active_areas() | Render the Template Active Areas and configured active fields for a given template id and post id |
render_add_row() | Returns an "add row" button for a template zone. |
set_dynamic_areas() | Returns whether the widgets should be dynamic; based on the plugin setting. |
add_scripts_and_styles() | Enqueue scripts and styles at Views editor |
enqueue_gravity_forms_scripts() | Enqueue Gravity Forms scripts, needed for Merge Tags |
register_no_conflict() | Add GravityView scripts and styles to Gravity Forms and GravityView No-Conflict modes |
add_clear_all_fields_action() | Renders a "Clear all fields" button in the View configuration. |
Method Reference
get_instance()
public static function get_instance(): self
Returns the singleton.
Returns
self
Since: 2.42
Source: includes/class-admin-views.php:44
disable_views_overview_notices()
public function disable_views_overview_notices()
Disables all notices and footer text on the Views overview page.
Returns
void
Since: 2.33
Source: includes/class-admin-views.php:110
is_views_overview_page()
public function is_views_overview_page(): bool
Checks if the current page is the Views overview page.
Returns
bool
Since: 2.33
Source: includes/class-admin-views.php:141
suggest_support_articles()
function suggest_support_articles( $localization_data=[] )
When on the Add/Edit View screen, suggest most popular articles related to that
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$localization_data | array | [] | Data to be passed to the Support Port JS |
Returns
array
Source: includes/class-admin-views.php:182
filter_pre_get_posts()
public function filter_pre_get_posts( &$query )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
&$query | WP_Query |
Since: 1.15
Source: includes/class-admin-views.php:206
add_view_dropdown()
public function add_view_dropdown()
Adds dropdown selects to filter Views by connected form and layout
Returns
void
Source: includes/class-admin-views.php:253
render_setting_row()
public static function render_setting_row( $key='', $current_settings=[], $override_input=null, $name='template_settings[%s]', $id='gravityview_se_%s' )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key | '' | ||
$current_settings | [] | ||
$override_input | null | ||
$name | 'template_settings[%s]' | ||
$id | 'gravityview_se_%s' |
Deprecated: since 1.2 Start using GravityView_Render_Settings::render_setting_row
Source: includes/class-admin-views.php:326
render_field_option()
public static function render_field_option( $name='', $option=[], $curr_value=null )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$name | '' | ||
$option | [] | ||
$curr_value | null |
Deprecated: since 1.2 Start using GravityView_Render_Settings::render_field_option
Source: includes/class-admin-views.php:343
gform_toolbar_menu()
public static function gform_toolbar_menu( $menu_items=[], $id=null )
Add a GravityView menu to the Form Toolbar with connected views
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$menu_items | array | [] | Menu items, as set in GFForms::top_toolbar() |
$id | int | null | ID of the current Gravity form |
Returns
array— Modified array
Source: includes/class-admin-views.php:359
default_field_blocklist()
public function default_field_blocklist( $array=[], $context=null )
List the field types without presentation properties (on a View context)
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$array | array | [] | Existing field types to add to a blocklist |
$context | string | null | null | Context for the blocklist. Default: NULL. |
Returns
array— Default blocklist fields merged with existing blocklist fields
Since: 2.14
Source: includes/class-admin-views.php:448
default_field_blacklist()
public function default_field_blacklist( $array, $context )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$array | |||
$context |
Deprecated: 2.14
Source: includes/class-admin-views.php:464
tooltips()
public function tooltips( $tooltips=[] )
Add tooltip text for use throughout the UI
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tooltips | array | [] | Array of Gravity Forms tooltips |
Returns
array— Modified tooltips array
Source: includes/class-admin-views.php:476
add_custom_column_content()
public function add_custom_column_content( $column_name=null, $post_id=0 )
Add the Data Source information
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$column_name | null | null | Name of the column in the Views table. |
$post_id | int | 0 | Post ID. |
Returns
void
Source: includes/class-admin-views.php:547
get_connected_form_links()
public static function get_connected_form_links( $form, $include_form_link=true )
Get HTML links relating to a connected form, like Edit, Entries, Settings, Preview
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | int | Gravity Forms forms array, or the form ID | |
$include_form_link | boolean | true | Whether to include the bold name of the form in the output |
Returns
string— HTML links
Source: includes/class-admin-views.php:637
add_post_type_columns()
public function add_post_type_columns( $columns )
Add the Data Source column to the Views page
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$columns | array | Columns array |
Source: includes/class-admin-views.php:723
save_postdata()
function save_postdata( $post_id )
Save View configuration
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$post_id | int | Currently saved Post ID |
Returns
void
Source: includes/class-admin-views.php:762
render_label()
function render_label()
Deprecated: 1.1.6
Source: includes/class-admin-views.php:874
render_available_fields()
function render_available_fields( $form_id=0, $context='single' )
Render html for displaying available fields based on a Form ID
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | string | 0 | Gravity Forms form ID. Default: 0. |
$context | string | 'single' | (default: 'single') |
Returns
void
See Also
\GravityView_Ajax::get_available_fields_html()Triggersgravityview_render_available_fieldsaction
Source: includes/class-admin-views.php:890
render_additional_fields()
public function render_additional_fields( $form_id=0, $context='single' )
Render html for displaying additional fields based on a Form ID
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | string | 0 | Gravity Forms form ID. Default: 0. |
$context | string | 'single' | (default: 'single') |
Returns
void
Source: includes/class-admin-views.php:961
get_entry_default_fields()
function get_entry_default_fields( $form, $zone )
Retrieve the default fields id, label and type
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | string | array | form_ID or form object | |
$zone | string | Either 'single', 'directory', 'header', 'footer' |
Returns
array
Source: includes/class-admin-views.php:1025
get_available_fields()
function get_available_fields( $form='', $zone=null )
Calculate the available fields
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | string | array | '' | form_ID or form object |
$zone | string | null | Either 'single', 'directory', 'header', 'footer' |
Returns
array— fields
Source: includes/class-admin-views.php:1059
render_available_widgets()
function render_available_widgets()
Render html for displaying available widgets
Returns
void
Source: includes/class-admin-views.php:1118
get_registered_widgets()
function get_registered_widgets()
Get the list of registered widgets. Each item is used to instantiate a GravityView_Admin_View_Widget object
Returns
array
Since: 1.13.1
Deprecated: Use \GV\Widget::registered()
Source: includes/class-admin-views.php:1137
render_active_areas()
function render_active_areas( $template_id, $type, $zone, $rows, $values )
Generic function to render rows and columns of active areas for widgets & fields
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$template_id | string | The current slug of the selected View template | |
$type | string | Either 'widget' or 'field' | |
$zone | string | Either 'single', 'directory', 'edit', 'header', 'footer' | |
$rows | array | The layout structure: rows, columns and areas | |
$values | array | Saved objects |
Returns
void
Source: includes/class-admin-views.php:1154
render_actions()
public function render_actions( bool $is_dynamic, string $template_id, string $type, string $zone ): void
Renders the row actions.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$is_dynamic | bool | Whether the rows are actionable. | |
$template_id | string | ||
$type | string | ||
$zone | string |
Returns
void
Since: 2.31.0
Source: includes/class-admin-views.php:1422
render_widgets_active_areas()
function render_widgets_active_areas( $template_id='', $zone='', $post_id='' )
Render the widget active areas
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$template_id | string | '' | The current slug of the selected View template |
$zone | string | '' | Either 'header' or 'footer' |
$post_id | string | '' | Current Post ID (view) |
Returns
string— html
Source: includes/class-admin-views.php:1478
render_field_pickers()
function render_field_pickers( $context='directory', $form_ids=[] )
Renders "Add Field" tooltips
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$context | string | 'directory' | "directory", "single", "edit" or "search". |
$form_ids | array | [] | (default: array) Array of form IDs. |
Returns
void
Since: 2.0.11
Source: includes/class-admin-views.php:1581
render_directory_active_areas()
function render_directory_active_areas( $template_id='', $context='single', $post_id=0, $echo=false, $form_id=0 )
Render the Template Active Areas and configured active fields for a given template id and post id
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$template_id | string | '' | (default: '') Template ID, like default_list, default_table, preset_business_data, etc. \GravityView_Template::__construct() |
$context | string | 'single' | (default: 'single') Context of the template. single or directory (edit not implemented but valid). |
$post_id | string | 0 | (default: '') ID of the View CPT. Used to get the fields for the View. |
$echo | bool | false | (default: false) Whether to echo the output or return it. Default: false. |
$form_id | int | 0 | (default: 0) Main form ID for the View. Used to set default fields for a new View. |
Returns
string— HTML of the active areas
Source: includes/class-admin-views.php:1644
render_add_row()
public function render_add_row( string $template_id, string $type, string $zone, bool $is_dynamic ): void
Returns an "add row" button for a template zone.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$template_id | string | The template ID. | |
$type | string | The object type (widget or field).) | |
$zone | string | The zone ID. | |
$is_dynamic | bool | Whether the zone is dynamic. |
Returns
void
Since: 2.31.0
Source: includes/class-admin-views.php:1755
set_dynamic_areas()
public function set_dynamic_areas( bool $is_dynamic, string $_, string $type, string $zone ): bool
Returns whether the widgets should be dynamic; based on the plugin setting.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$is_dynamic | bool | Whether the zone is dynamic. | |
$_ | string | The template ID (unused)) | |
$type | string | The object type (widget or field). | |
$zone | string |
Returns
bool— Whether the widgets should be dynamic.
Since: 2.31.0
Source: includes/class-admin-views.php:1834
add_scripts_and_styles()
static function add_scripts_and_styles( $hook )
Enqueue scripts and styles at Views editor
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$hook | mixed |
Returns
void
Source: includes/class-admin-views.php:1950
enqueue_gravity_forms_scripts()
static function enqueue_gravity_forms_scripts()
Enqueue Gravity Forms scripts, needed for Merge Tags
Returns
void
Since: 1.0.5-beta
Source: includes/class-admin-views.php:2104
register_no_conflict()
function register_no_conflict( $registered )
Add GravityView scripts and styles to Gravity Forms and GravityView No-Conflict modes
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$registered | array | Existing scripts or styles that have been registered (array of the handles) |
Returns
array
Source: includes/class-admin-views.php:2135
add_clear_all_fields_action()
public function add_clear_all_fields_action( $area, $type, $values, $is_dynamic, $template_id, $zone ): void
Renders a "Clear all fields" button in the View configuration.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$area | array | The area. | |
$type | string | The type. | |
$values | |||
$is_dynamic | bool | Whether the zone is dynamic. | |
$template_id | string | The template ID. | |
$zone | string | The zone. |
Returns
void
Since: 2.44
Source: includes/class-admin-views.php:2191