GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
Static Public Member Functions | |
static | directory_link ( $post_id=NULL, $add_query_args=true, $context=null) |
Generate a URL to the Directory context. More... | |
static | entry_create_custom_slug ( $entry, $form) |
If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta. More... | |
static | entry_link ( $entry, $post_id=NULL, $add_directory_args=true, $view_id=0) |
return href for single entry More... | |
static | entry_link_html ( $entry=array(), $anchor_text='', $passed_tag_atts=array(), $field_settings=array(), $base_id=null) |
Generate an anchor tag that links to an entry. More... | |
static | field_class ( $field, $form=NULL, $entry=NULL) |
Fetch Field class. More... | |
static | field_html_attr_id ( $field, $form=array(), $entry=array()) |
Fetch Field HTML ID. More... | |
static | field_label ( $field, $entry=array(), $force_show_label=false) |
Fetch Field Label. More... | |
static | field_value ( $entry, $field_settings, $format='html') |
Given an entry and a form field id, calculate the entry value for that field. More... | |
static | field_width ( $field, $format='%d%%') |
Get column width from the field setting. More... | |
static | get_entry_slug ( $id_or_string, $entry=array()) |
Get the entry slug for the entry. More... | |
static | no_results ( $wpautop=true, $context=null) |
Get the "No Results" text depending on whether there were results. More... | |
static | replace_variables ( $text, $form=array(), $entry=array(), $url_encode=false, $esc_html=true, $nl2br=true, $format='html', $aux_data=array()) |
Alias for GravityView_Merge_Tags::replace_variables() More... | |
Static Private Member Functions | |
static | get_custom_entry_slug ( $id, $entry=array()) |
Calculate an unique hash for an entry based on the entry ID. More... | |
Definition at line 14 of file class-api.php.
|
static |
Generate a URL to the Directory context.
Uses local static variable to speed up repeated requests to get permalink, which improves load time. Since we may be doing this hundreds of times per request, it adds up!
int | $post_id | Post ID |
boolean | $add_query_args | Add pagination and sorting arguments |
\GV\Template_Context | $context | The context this is being used in. |
If we've saved the permalink, use it. Reduces time spent on get_permalink()
, which is heavy.
gravityview_directory_link
Modify the URL to the View "directory" context string | $link | URL to the View's "directory" context (Multiple Entries screen) |
int | $post_id | ID of the post to link to. If the View is embedded, it is the post or page ID |
gravityview/view/links/directory
Modify the URL to the View "directory" context string | $link | URL to the View's "directory" context (Multiple Entries screen) |
\GV\Template_Context | $context |
Definition at line 399 of file class-api.php.
References $add_query_args, $args, $gravityview_view, $link, $post, Utils\_GET(), Utils\_POST(), GravityView_frontend\getInstance(), GravityView_View\getInstance(), and gravityview().
Referenced by GravityView_Delete_Entry\get_delete_link(), GravityView_Duplicate_Entry\get_duplicate_link(), gv_directory_link(), and GravityView_Edit_Entry_Render\maybe_print_message().
|
static |
If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta.
Triggered by add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 );
$entry | array Gravity Forms entry object |
$form | array Gravity Forms form object |
gravityview_custom_entry_slug
On entry creation, check if we are using the custom entry slug feature and update the meta boolean | $custom | Should we process the custom entry slug? |
Definition at line 620 of file class-api.php.
References $entry, and gravityview().
|
static |
return href for single entry
gravityview/entry_link/add_query_args
filter to override.array | int | $entry | Entry array or entry ID. |
int | null | $post_id | If wanting to define the parent post, pass a post ID. |
boolean | $add_directory_args | True: Add args to help return to directory; False: only include args required to get to entry. |
int | $view_id |
gravityview/entry_link/add_query_args
Modify whether to include passed $_GET parameters to the end of the url bool | $add_query_params | Whether to include passed $_GET parameters to the end of the Entry Link URL. Default: true. |
Make sure the $directory_link doesn't contain any query otherwise it will break when adding the entry slug.
Definition at line 656 of file class-api.php.
References $add_query_args, $args, $entry, $entry_slug, $forms, $view_id, Utils\_GET(), View_Collection\from_post(), Entry\get_endpoint_name(), GVCommon\get_entry(), get_entry_slug(), GravityView_frontend\getInstance(), GravityView_View_Data\getInstance(), gravityview_get_view_id(), and gv_get_query_args().
Referenced by GravityView_Entry_List\get_item_output(), GravityView_Entry_Link_Shortcode\get_url(), gv_entry_link(), and GravityView_Theme_Hooks_WPML\wpml_ls_filter().
|
static |
Generate an anchor tag that links to an entry.
string | $anchor_text | The text or HTML inside the link |
array | $entry | Gravity Forms entry array |
array | string | $passed_tag_atts | Attributes to be added to the anchor tag, such as title or rel . |
array | $field_settings | Array of field settings. Optional, but passed to the gravityview_field_entry_link filter |
int | $base_id | The post or the view that this entry is linked from. |
gravityview_field_entry_link
Modify the link HTML string | $link | HTML output of the link |
string | $href | URL of the link |
array | $entry | The GF entry array |
array | $field_settings | Settings for the particular GV field |
Definition at line 259 of file class-api.php.
References $entry, $field_settings, $href, $link, $output, gravityview(), and gravityview_get_link().
|
static |
Fetch Field class.
mixed | $field |
Definition at line 157 of file class-api.php.
References $entry, $field, GV\$form, $form_id, $gravityview_view, GravityView_View\getInstance(), and gravityview().
Referenced by gv_class().
|
static |
Fetch Field HTML ID.
array | $field | GravityView field array passed to gravityview_field_output() |
array | $form | Gravity Forms form array, if set. |
array | $entry | Gravity Forms entry array |
id
attribute for the field Definition at line 209 of file class-api.php.
References $field, GV\$form, $form_id, $gravityview_view, GravityView_View\getInstance(), and gravityview().
Referenced by gravityview_field_output().
|
static |
Fetch Field Label.
array | $field | GravityView field array |
array | $entry | Gravity Forms entry array |
boolean | $force_show_label | Whether to always show the label, regardless of field settings |
Allow to fall through for back compatibility testing purposes.
gravityview_render_after_label
Append content to a field label string | $appended_content | Content you can add after a label. Empty by default. |
array | $field | GravityView field array |
gravityview/template/field_label
Modify field label output string | $label | Field label HTML |
array | $field | GravityView field array |
array | $form | Gravity Forms form array |
array | $entry | Gravity Forms entry array |
Definition at line 27 of file class-api.php.
References $entry, $field, GV\$form, $gravityview_view, $label, GravityView_View\getInstance(), and GV\Mocks\GravityView_API_field_label().
Referenced by gv_label().
|
static |
Given an entry and a form field id, calculate the entry value for that field.
array | $entry | |
array | $field |
Definition at line 238 of file class-api.php.
References $entry, $field_settings, $format, gravityview(), and GV\Mocks\GravityView_API_field_value().
Referenced by gv_value().
|
static |
Get column width from the field setting.
array | $field | Array of settings for the field |
string | $format | Format for width. "%" (default) will return |
Definition at line 132 of file class-api.php.
References $field, and $format.
Referenced by gravityview_field_output().
|
staticprivate |
Calculate an unique hash for an entry based on the entry ID.
This allows you to be more discrete as to the number of the entry - if you don't want users to know that you have made a certain number of sales, for example, or that their entry in the giveaway is entry #3.
The hashed value MUST be unique, otherwise multiple entries will share the same URL, which leads to obvious problems.
int | string | $id | Entry ID to generate the hash for. |
array | $entry | Entry data passed to provide additional information when generating the hash. Optional - don't rely on it being available. |
gravityview_entry_slug
Modify the unique hash ID generated, if you want to improve usability or change the format. This will allow for custom URLs, such as {entryid}-{first-name}
or even, if unique, {first-name}-{last-name}
string | $hash | Existing hash generated by GravityView |
string | $id | The entry ID |
array | $entry | Entry data array. May be empty. |
Definition at line 518 of file class-api.php.
References $entry.
|
static |
Get the entry slug for the entry.
By default, it is the entry ID.
int | string | $id_or_string | ID of the entry, or custom slug string |
array | $entry | Gravity Forms Entry array, optional. Used only to provide data to customize the gravityview_entry_slug filter |
sanitize_title()
Default: use the entry ID as the unique identifier
gravityview_custom_entry_slug
Whether to enable and use custom entry slugs. boolean | True: Allow for slugs based on entry values. False: always use entry IDs (default) |
Definition at line 550 of file class-api.php.
References $entry, $value, and gravityview().
Referenced by entry_link(), and Entry\get_slug().
|
static |
Get the "No Results" text depending on whether there were results.
boolean | $wpautop | Apply wpautop() to the output? |
\GV\Template_Context | null | $context | The context |
Added now that users are able to modify via View settings
gravitview_no_entries_text
Modify the text displayed when there are no entries. Note: this filter is, and always has been, misspelled. This will not be fixed, since the filter is deprecated. string | $output | The existing "No Entries" text |
boolean | $is_search | Is the current page a search result, or just a multiple entries screen? |
gravityview/template/text/no_entries
Modify the text displayed when there are no entries. string | $output | The existing "No Entries" text. |
boolean | $is_search | Is the current page a search result, or just a multiple entries screen? |
\GV\Template_Context | $context | The context. |
string | $unformatted_output | Output without wpautop() . |
Definition at line 296 of file class-api.php.
References $gravityview_view, $output, and GravityView_View\getInstance().
Referenced by gv_no_results().
|
static |
Alias for GravityView_Merge_Tags::replace_variables()
string | $text | Text to replace variables in |
array | $form | GF Form array |
array | $entry | GF Entry array |
bool | $url_encode | Pass return value through url_encode() |
bool | $esc_html | Pass return value through esc_html() |
bool | $nl2br | Convert newlines to HTML tags |
string | $format | The format requested for the location the merge is being used. Possible values: html, text or url. |
array | $aux_data | Additional data to be used to replace merge tags { |
Definition at line 118 of file class-api.php.
References $entry, GV\$form, $format, and GravityView_Merge_Tags\replace_variables().
Referenced by GravityView_frontend\_get_single_entry_title(), Entry_Template\get_back_label(), GravityView_Entry_List\get_item_output(), GravityView_View\getBackLinkLabel(), GV\Mocks\GravityView_API_field_label(), and Field_Template\render().