![]() |
GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
If this file is called directly, abort. More...
Public Member Functions | |
| __construct ( $atts=array()) | |
| Construct the view object. More... | |
| __get ( $name) | |
| Magic Method: Instead of throwing an error when a variable isn't set, return null. More... | |
| _include ( $path) | |
| Include a file inside this context. More... | |
| add_id_specific_templates ( $templates, $slug, $name) | |
| Enable overrides of GravityView templates on a granular basis. More... | |
| clearCurrentEntry () | |
| Clear the current entry after all entries in the loop have been displayed. More... | |
| getAtts ( $key=NULL) | |
| getBackLinkLabel ( $do_replace=true) | |
| getContext () | |
| getContextFields ( $context='') | |
| Get the fields for a specific context. More... | |
| getCurrentEntry () | |
| Return the current entry. More... | |
| getCurrentField ( $key=NULL) | |
| getCurrentFieldSetting ( $key) | |
| getEntries () | |
| getField ( $key) | |
| getFields ( $key=null) | |
| getForm () | |
| getFormId () | |
| getPaginationCounts () | |
| Get an array with pagination information. More... | |
| getPaging () | |
| getPostId () | |
| getSorting () | |
| getTemplatePartName () | |
| getTemplatePartSlug () | |
| getTotalEntries () | |
| getViewId () | |
| isHideUntilSearched () | |
| locate_template ( $template_names, $load=false, $require_once=true) | |
| In order to improve lookup times, we store located templates in a local array. More... | |
| render ( $slug, $name, $require_once=true) | |
| render_widget_hooks ( $view_id_or_context) | |
| Output the widgets on before/after hooks. More... | |
| renderZone ( $zone='', $atts=array(), $echo=true) | |
| Render an output zone, as configured in the Admin. More... | |
| setAtts ( $atts) | |
| setBackLinkLabel ( $back_link_label) | |
| setContext ( $context) | |
| setCurrentEntry ( $current_entry) | |
| setCurrentField ( $passed_field) | |
| setCurrentFieldSetting ( $key, $value) | |
| setEntries ( $entries) | |
| setField ( $key, $value) | |
| setFields ( $fields) | |
| setForm ( $form) | |
| setFormId ( $form_id) | |
| setHideUntilSearched ( $hide_until_searched) | |
| setPaging ( $paging) | |
| setPostId ( $post_id) | |
| setSorting ( $sorting) | |
| setTemplatePartName ( $template_part_name) | |
| setTemplatePartSlug ( $template_part_slug) | |
| setTotalEntries ( $total_entries) | |
| setViewId ( $view_id) | |
Static Public Member Functions | |
| static | getInstance ( $passed_post=NULL) |
Data Fields | |
| $view_id = null | |
Static Public Attributes | |
| static | $instance = NULL |
Protected Attributes | |
| $_current_entry = array() | |
| Current entry in the loop. More... | |
| $_current_field = array() | |
| $atts = array() | |
| $back_link_label = '' | |
| $context = 'directory' | |
| $entries = array() | |
| $fields = array() | |
| $filter_prefix = 'gravityview' | |
| Prefix for filter names. More... | |
| $form = null | |
| $form_id = null | |
| $hide_until_searched = false | |
| $located_templates = array() | |
| Store templates locations that have already been located. More... | |
| $paging = array() | |
| $plugin_directory = GRAVITYVIEW_DIR | |
| Reference to the root directory path of this plugin. More... | |
| $post_id = null | |
| $sorting = array() | |
| $template_part_name = '' | |
| The name of the file part, like "body" or "single". More... | |
| $template_part_slug = '' | |
| The name of the template, like "list", "table", or "datatables". More... | |
| $theme_template_directory = 'gravityview' | |
| Directory name where custom templates for this plugin should be found in the theme. More... | |
| $total_entries = 0 | |
If this file is called directly, abort.
Definition at line 23 of file class-template.php.
| __construct | ( | $atts = array() | ) |
Construct the view object.
| array | $atts | Associative array to set the data of |
Clear the current entry after the loop is done
Definition at line 155 of file class-template.php.
| __get | ( | $name | ) |
Magic Method: Instead of throwing an error when a variable isn't set, return null.
| string | $name | Key for the data retrieval. |
Definition at line 764 of file class-template.php.
References $name.
| _include | ( | $path | ) |
Include a file inside this context.
| string | $path | A path to the legacy template to include. |
Definition at line 967 of file class-template.php.
| add_id_specific_templates | ( | $templates, | |
| $slug, | |||
| $name | |||
| ) |
Enable overrides of GravityView templates on a granular basis.
The loading order is:
| array | $templates | Existing list of templates. |
| string | $slug | Name of the template base, example: table, list, datatables, map |
| string | $name | Name of the template part, example: body, footer, head, single |
Definition at line 789 of file class-template.php.
References $name, $templates, $view_id, getFormId(), getPostId(), getViewId(), and gravityview().
| clearCurrentEntry | ( | ) |
Clear the current entry after all entries in the loop have been displayed.
Definition at line 633 of file class-template.php.
| getAtts | ( | $key = NULL | ) |
| string | null | $key | The key to a specific field in the fields array |
Definition at line 260 of file class-template.php.
References $atts.
Referenced by renderZone().
| getBackLinkLabel | ( | $do_replace = true | ) |
| boolean | $do_replace | Perform merge tag and shortcode processing on the label. Default: true. |
Definition at line 540 of file class-template.php.
References $back_link_label, getCurrentEntry(), getForm(), and GravityView_API\replace_variables().
| getContext | ( | ) |
Definition at line 310 of file class-template.php.
References $context.
Referenced by getContextFields(), getCurrentEntry(), and renderZone().
| getContextFields | ( | $context = '' | ) |
Get the fields for a specific context.
| string | $context | [Optional] "directory", "single", or "edit" |
Definition at line 345 of file class-template.php.
References $context, $fields, getContext(), and getFields().
| getCurrentEntry | ( | ) |
Return the current entry.
If in the loop, the current entry. If single entry, the currently viewed entry.
Definition at line 602 of file class-template.php.
References $_current_entry, $entries, $entry, getContext(), and getEntries().
Referenced by getBackLinkLabel(), and renderZone().
| getCurrentField | ( | $key = NULL | ) |
| string | null | $key | The key to a specific attribute of the current field |
Definition at line 208 of file class-template.php.
References $_current_field.
Referenced by getCurrentFieldSetting(), and setCurrentField().
| getCurrentFieldSetting | ( | $key | ) |
Definition at line 228 of file class-template.php.
References $settings, and getCurrentField().
| getEntries | ( | ) |
Definition at line 427 of file class-template.php.
References $entries.
Referenced by getCurrentEntry().
| getField | ( | $key | ) |
| string | $key | The key to a specific field in the fields array |
Definition at line 377 of file class-template.php.
Referenced by renderZone().
| getFields | ( | $key = null | ) |
| string | null | $key | The key to a specific field in the fields array |
Definition at line 325 of file class-template.php.
References $fields.
Referenced by getContextFields().
| getForm | ( | ) |
Definition at line 282 of file class-template.php.
References $form.
Referenced by getBackLinkLabel(), and renderZone().
| getFormId | ( | ) |
Definition at line 413 of file class-template.php.
References $form_id.
Referenced by add_id_specific_templates().
|
static |
| null | $passed_post |
Definition at line 195 of file class-template.php.
Referenced by GravityView_frontend\add_columns_sort_links(), View_List_Template\body_after(), View_Table_Template\body_after(), View_List_Template\body_before(), View_Table_Template\body_before(), GravityView_Delete_Entry\check_user_cap_delete_entry(), GravityView_Edit_Entry\check_user_cap_edit_entry(), GravityView_frontend\context_not_configured_warning(), GravityView_API\directory_link(), GravityView_Field_Notes\display_note(), GravityView_Plugin_Hooks_Gravity_Forms_Signature\edit_entry_field_input(), GravityView_Widget_Search\enqueue_datepicker(), View_List_Template\entry_after(), View_List_Template\entry_before(), View_List_Template\entry_class(), View_Table_Template\entry_class(), GravityView_API\field_class(), GravityView_API\field_html_attr_id(), GravityView_API\field_label(), Legacy_Context\freeze(), GravityView_Field_Notes\get_add_note_part(), GravityView_Entry_Link_Shortcode\get_entry(), GravityView_Field_FileUpload\get_files_array(), GravityView_Field_Notes\get_note_emails_array(), GravityView_Entry_List\get_output(), GravityView_Widget_Search\get_search_class(), GravityView_frontend\get_search_criteria_paging(), GravityView_Widget_Search\get_search_filter_details(), GravityView_Widget_Search\get_search_form_action(), GravityView_Plugin_Hooks_Gravity_Flow\get_status_options(), GravityView_Shortcode\get_view_detail(), GravityView_Field_Workflow_Step\get_workflow_step(), gravityview_back_link(), gravityview_get_view_id(), gv_container_class(), Legacy_Context\load(), GravityView_Field_Workflow_Step\modify_frontend_search_fields(), GravityView_API\no_results(), GravityView_Edit_Entry_Render\print_scripts(), GravityView_Field_Entry_Approval\register_scripts_and_styles(), Entry_Legacy_Template\render(), View_Legacy_Template\render(), Legacy_Override_Template\render(), GravityView_Widget_Page_Links\render_frontend(), GravityView_Widget_Pagination_Info\render_frontend(), GravityView_Widget_Poll\render_frontend(), oEmbed\render_frontend(), GravityView_Widget_Search\render_frontend(), render_widget_hooks(), GravityView_Field_Sequence\replace_merge_tag(), GravityView_Field_Address\search_field_filter(), GravityView_Edit_Entry_Render\setup_vars(), GravityView_Entry_Link_Shortcode\shortcode(), Legacy_Context\thaw(), GravityView_Widget_Search\the_clear_search_button(), Entry_Table_Template\the_entry(), View_Table_Template\the_entry(), View_Table_Template\tr_after(), View_Table_Template\tr_before(), and GravityView_Search_WP_Widget\widget().
| getPaginationCounts | ( | ) |
Get an array with pagination information.
gravityview_pagination_counts Modify the displayed pagination numbers | array | $counts | Array with $first, $last, $total numbers in that order |
Definition at line 483 of file class-template.php.
References $paging, getPaging(), getTotalEntries(), and gravityview().
| getPaging | ( | ) |
Definition at line 455 of file class-template.php.
Referenced by getPaginationCounts().
| getPostId | ( | ) |
Definition at line 296 of file class-template.php.
References $post_id.
Referenced by add_id_specific_templates().
| getSorting | ( | ) |
Definition at line 514 of file class-template.php.
| getTemplatePartName | ( | ) |
| getTemplatePartSlug | ( | ) |
Definition at line 573 of file class-template.php.
References $template_part_slug.
Referenced by renderZone().
| getTotalEntries | ( | ) |
Definition at line 441 of file class-template.php.
References $total_entries.
Referenced by getPaginationCounts().
| getViewId | ( | ) |
Definition at line 399 of file class-template.php.
Referenced by add_id_specific_templates().
| isHideUntilSearched | ( | ) |
| locate_template | ( | $template_names, | |
$load = false, |
|||
$require_once = true |
|||
| ) |
In order to improve lookup times, we store located templates in a local array.
This improves performance by up to 1/2 second on a 250 entry View with 7 columns showing
Definition at line 736 of file class-template.php.
| render | ( | $slug, | |
| $name, | |||
$require_once = true |
|||
| ) |
Definition at line 816 of file class-template.php.
References $name, gravityview(), setTemplatePartName(), and setTemplatePartSlug().
| render_widget_hooks | ( | $view_id_or_context | ) |
Output the widgets on before/after hooks.
| int | \GV\Template_Context | $view_id_or_context | The View ID or the context. |
Fake new context for legacy template code.
Prevent output if no widgets to show.
gravityview/widgets/wrapper_css_class The CSS class applied to the widget container <div>. | string | $css_class | Default: gv-grid gv-widgets-{zone} where {zone} is replaced by the current $zone value. If the View has no results, adds gv-widgets-no-results |
| string | $zone | Current widget zone, either header or footer |
| array | $widgets | Array of widget configurations for the current zone, as set by `gravityview_get_current_view_data()['widgets']` |
Prevent widgets from being called twice. Checking for loop_start prevents themes and plugins that pre-process shortcodes from triggering the action before displaying. Like, ahem, the Divi theme and WordPress SEO plugin
Definition at line 844 of file class-template.php.
References $total_entries, View\by_id(), Template_Context\from_template(), Widget\get_default_widget_areas(), getInstance(), gravityview(), and gravityview_get_context().
| renderZone | ( | $zone = '', |
|
$atts = array(), |
|||
$echo = true |
|||
| ) |
Render an output zone, as configured in the Admin.
| string | $zone | The zone name, like 'footer-left' |
| array | $atts | |
| bool | $echo | Whether to print the output |
gravityview_table_cells Modify the fields displayed in a table | array | $fields | |
| \GravityView_View | $this |
If a zone has no field output, choose whether to show wrapper False by default to keep backward compatibility
| boolean | $hide_empty_zone | Default: false |
| \GV\Template_Context | $context | The context. Null here. Since this path is deprecated. |
Definition at line 650 of file class-template.php.
References $atts, $field, $fields, $output, getAtts(), getContext(), getCurrentEntry(), getField(), getForm(), getTemplatePartSlug(), gravityview(), and gravityview_field_output().
| setAtts | ( | $atts | ) |
| setBackLinkLabel | ( | $back_link_label | ) |
| string | $back_link_label |
Definition at line 552 of file class-template.php.
References $back_link_label.
| setContext | ( | $context | ) |
| setCurrentEntry | ( | $current_entry | ) |
| setCurrentField | ( | $passed_field | ) |
| array | $passed_field |
Backward compatibility
Definition at line 241 of file class-template.php.
References getCurrentField().
| setCurrentFieldSetting | ( | $key, | |
| $value | |||
| ) |
Definition at line 220 of file class-template.php.
References $value.
| setEntries | ( | $entries | ) |
| setField | ( | $key, | |
| $value | |||
| ) |
| string | $key | The key to a specific field in the fields array |
| mixed | $value | The value to set for the field |
Definition at line 392 of file class-template.php.
References $value.
| setFields | ( | $fields | ) |
| setForm | ( | $form | ) |
| setFormId | ( | $form_id | ) |
| setHideUntilSearched | ( | $hide_until_searched | ) |
| boolean | $hide_until_searched |
Definition at line 566 of file class-template.php.
References $hide_until_searched.
| setPaging | ( | $paging | ) |
| setPostId | ( | $post_id | ) |
| int | null | $post_id |
Definition at line 303 of file class-template.php.
References $post_id.
| setSorting | ( | $sorting | ) |
| setTemplatePartName | ( | $template_part_name | ) |
| string | $template_part_name |
Definition at line 594 of file class-template.php.
References $template_part_name.
Referenced by render().
| setTemplatePartSlug | ( | $template_part_slug | ) |
| string | $template_part_slug |
Definition at line 580 of file class-template.php.
References $template_part_slug.
Referenced by render().
| setTotalEntries | ( | $total_entries | ) |
| int | $total_entries |
Definition at line 448 of file class-template.php.
References $total_entries.
| setViewId | ( | $view_id | ) |
|
protected |
Current entry in the loop.
Definition at line 139 of file class-template.php.
Referenced by getCurrentEntry().
|
protected |
Definition at line 144 of file class-template.php.
Referenced by getCurrentField().
|
protected |
Definition at line 101 of file class-template.php.
Referenced by __construct(), getAtts(), renderZone(), and setAtts().
|
protected |
Definition at line 116 of file class-template.php.
Referenced by getBackLinkLabel(), and setBackLinkLabel().
|
protected |
Definition at line 86 of file class-template.php.
Referenced by getContext(), getContextFields(), and setContext().
|
protected |
Definition at line 106 of file class-template.php.
Referenced by getCurrentEntry(), getEntries(), and setEntries().
|
protected |
Definition at line 81 of file class-template.php.
Referenced by getContextFields(), getFields(), renderZone(), and setFields().
|
protected |
Prefix for filter names.
Definition at line 30 of file class-template.php.
|
protected |
Definition at line 96 of file class-template.php.
|
protected |
Definition at line 70 of file class-template.php.
Referenced by getFormId(), and setFormId().
|
protected |
Definition at line 132 of file class-template.php.
Referenced by isHideUntilSearched(), and setHideUntilSearched().
|
static |
Definition at line 149 of file class-template.php.
Referenced by oEmbed\render_frontend(), and Legacy_Context\reset().
|
protected |
Store templates locations that have already been located.
Definition at line 51 of file class-template.php.
|
protected |
Definition at line 121 of file class-template.php.
Referenced by getPaginationCounts(), and setPaging().
|
protected |
Reference to the root directory path of this plugin.
Definition at line 44 of file class-template.php.
|
protected |
Definition at line 91 of file class-template.php.
Referenced by getPostId(), and setPostId().
|
protected |
Definition at line 126 of file class-template.php.
Referenced by setSorting().
|
protected |
The name of the file part, like "body" or "single".
Definition at line 65 of file class-template.php.
Referenced by getTemplatePartName(), and setTemplatePartName().
|
protected |
The name of the template, like "list", "table", or "datatables".
Definition at line 58 of file class-template.php.
Referenced by getTemplatePartSlug(), and setTemplatePartSlug().
|
protected |
Directory name where custom templates for this plugin should be found in the theme.
Definition at line 37 of file class-template.php.
|
protected |
Definition at line 111 of file class-template.php.
Referenced by getTotalEntries(), render_widget_hooks(), and setTotalEntries().
| $view_id = null |
Definition at line 76 of file class-template.php.
Referenced by add_id_specific_templates(), and setViewId().