GravityView  1.22.6
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions
GravityView_Field_Entry_Approval Class Reference

Add custom options for address fields. More...

Inheritance diagram for GravityView_Field_Entry_Approval:
GravityView_Field

Public Member Functions

 __construct ()
 
 enqueue_and_localize_script ()
 Register the field approval script and output the localized text JS variables. More...
 
 field_options ( $field_options, $template_id='', $field_id='', $context='', $input_type='')
 Remove unused settings for the approval field. More...
 
 filter_gravityview_entry_default_field ( $entry_default_fields, $form, $context)
 Add Fields to the field list. More...
 
 maybe_prevent_field_render ( $html, $args)
 
 modify_search_parameters ( $parameters)
 Modify search to use is_approved meta key to sort, instead of entry_approval More...
 
 register_scripts_and_styles ()
 Register the field approval script and style. More...
 
- Public Member Functions inherited from GravityView_Field
 __construct ()
 GravityView_Field constructor. More...
 
 _filter_gform_custom_merge_tags ( $custom_merge_tags=array(), $form_id, $fields=array(), $element_id='')
 Add custom merge tags to merge tag options. More...
 
 _filter_gform_replace_merge_tags ( $text, $form=array(), $entry=array(), $url_encode=false, $esc_html=false)
 Match the merge tag in replacement text for the field. More...
 
 _filter_sortable_fields ( $not_sortable)
 Use field settings to modify whether a field is sortable. More...
 
 add_entry_meta ( $entry_meta)
 Add the custom entry meta key to make it searchable and sortable. More...
 
 add_field_support ( $key='', &$field_options)
 
 add_sortable_field ( $fields)
 Add the field to the Filter & Sort available fields. More...
 
 field_options ( $field_options, $template_id, $field_id, $context, $input_type)
 Tap in here to modify field options. More...
 
 replace_merge_tag ( $matches=array(), $text='', $form=array(), $entry=array(), $url_encode=false, $esc_html=false)
 Run GravityView filters when using GFCommon::replace_variables() More...
 
 set_default_search_label ( $label='', $gf_field=null, $field=array())
 Allow setting a default search label for search fields based on the field type. More...
 

Static Public Member Functions

static get_anchor_text ( $approved_status='')
 Get the anchor text for a link, based on the current status. More...
 
static get_css_class ( $approved_status)
 Get the CSS class for a link, based on the current status. More...
 
static get_title_attr ( $approved_status)
 Get the title attribute for a link, based on the current status. More...
 

Data Fields

 $contexts = array( 'single', 'multiple' )
 
 $group = 'gravityview'
 
 $is_numeric = true
 
 $is_searchable = true
 
 $is_sortable = true
 
 $name = 'entry_approval'
 
 $search_operators = array( 'is', 'isnot' )
 
- Data Fields inherited from GravityView_Field
 $_gf_field_class_name
 
 $contexts = array( 'single', 'multiple', 'edit', 'export' )
 
 $default_search_label
 
 $description
 
 $entry_meta_is_default_column = false
 
 $entry_meta_key = null
 
 $entry_meta_update_callback = null
 
 $group
 standard, advanced, post, pricing, meta, gravityview More...
 
 $is_numeric
 boolean Is field content number-based? More...
 
 $is_searchable = true
 
 $is_sortable = true
 boolean Can the field be sorted in search? More...
 
 $label
 
 $name
 
 $search_operators
 

Private Member Functions

 add_hooks ()
 Add filters and actions for the field. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GravityView_Field
 custom_merge_tags ( $form=array(), $fields=array())
 Add custom Merge Tags to Merge Tag options, if custom Merge Tags exist. More...
 
 is_choice_value_enabled ()
 Check whether the enableChoiceValue flag is set for a GF field. More...
 
- Protected Attributes inherited from GravityView_Field
 $_custom_merge_tag = false
 
 $_field_id = ''
 
 $_field_options = array()
 

Detailed Description

Add custom options for address fields.

Since
1.19

Definition at line 7 of file class-gravityview-field-approval.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Definition at line 23 of file class-gravityview-field-approval.php.

References add_hooks(), and description.

Member Function Documentation

◆ add_hooks()

add_hooks ( )
private

Add filters and actions for the field.

Since
1.19
Returns
void

Definition at line 65 of file class-gravityview-field-approval.php.

Referenced by __construct().

◆ enqueue_and_localize_script()

enqueue_and_localize_script ( )

Register the field approval script and output the localized text JS variables.

Since
1.19
Returns
void

Definition at line 158 of file class-gravityview-field-approval.php.

References GravityView_Entry_Approval_Status\get_all().

◆ field_options()

field_options (   $field_options,
  $template_id = '',
  $field_id = '',
  $context = '',
  $input_type = '' 
)

Remove unused settings for the approval field.

Since
1.19
Parameters
array$field_options
string$template_id
string$field_id
string$context
string$input_type
Returns
array

Definition at line 47 of file class-gravityview-field-approval.php.

◆ filter_gravityview_entry_default_field()

filter_gravityview_entry_default_field (   $entry_default_fields,
  $form,
  $context 
)

Add Fields to the field list.

Since
1.19
Parameters
array$entry_default_fieldsArray of fields shown by default
string | array$formform_ID or form object
string$contextEither 'single', 'directory', 'header', 'footer'
Returns
array

Definition at line 188 of file class-gravityview-field-approval.php.

References description.

◆ get_anchor_text()

static get_anchor_text (   $approved_status = '')
static

Get the anchor text for a link, based on the current status.

Since
1.19 GravityView_Entry_Approval_Status::get_string()
Parameters
string$approved_statusStatus string or key
Returns
false|string False if string doesn't exist, otherwise the "label" for the status

Definition at line 211 of file class-gravityview-field-approval.php.

References GravityView_Entry_Approval_Status\get_string().

◆ get_css_class()

static get_css_class (   $approved_status)
static

Get the CSS class for a link, based on the current status.

Parameters
int | string$approved_statusStatus string or key
Returns
string CSS class, sanitized using esc_attr()

Definition at line 236 of file class-gravityview-field-approval.php.

References GravityView_Entry_Approval_Status\get_key().

◆ get_title_attr()

static get_title_attr (   $approved_status)
static

Get the title attribute for a link, based on the current status.

Since
1.19 GravityView_Entry_Approval_Status::get_string()
Parameters
int | string$approved_statusStatus string or key
Returns
false|string

Definition at line 225 of file class-gravityview-field-approval.php.

References GravityView_Entry_Approval_Status\get_string().

◆ maybe_prevent_field_render()

maybe_prevent_field_render (   $html,
  $args 
)
Runs Filter:
gravityview/template/field_label Modify field label output
Since
1.19
Parameters
string$htmlExisting HTML output
array$argsArguments passed to the function
Returns
string Empty string if user doesn't have the gravityview_moderate_entries cap; field HTML otherwise

Definition at line 90 of file class-gravityview-field-approval.php.

References GVCommon\has_cap().

◆ modify_search_parameters()

modify_search_parameters (   $parameters)

Modify search to use is_approved meta key to sort, instead of entry_approval

Parameters
array$parametersSearch parameters used to generate GF search
Returns
array Same parameters, but if sorting by entry_approval, changed to is_approved

Definition at line 107 of file class-gravityview-field-approval.php.

◆ register_scripts_and_styles()

register_scripts_and_styles ( )

Register the field approval script and style.

Since
1.19
Returns
void

Override CSS file by placing in your theme's /gravityview/css/ sub-directory.

Runs Filter:
gravityview/field/approval/css_url URL to the Approval field CSS file.
Since
1.19
Parameters
string$style_urlOverride to use your own CSS file, or return empty string to disable loading.

Definition at line 123 of file class-gravityview-field-approval.php.

References GravityView_View\getInstance(), GRAVITYVIEW_DIR, GRAVITYVIEW_URL, and GravityView_Plugin\version.

Field Documentation

◆ $contexts

$contexts = array( 'single', 'multiple' )

Definition at line 21 of file class-gravityview-field-approval.php.

◆ $group

$group = 'gravityview'

Definition at line 19 of file class-gravityview-field-approval.php.

◆ $is_numeric

$is_numeric = true

Definition at line 17 of file class-gravityview-field-approval.php.

◆ $is_searchable

$is_searchable = true

Definition at line 11 of file class-gravityview-field-approval.php.

◆ $is_sortable

$is_sortable = true

Definition at line 15 of file class-gravityview-field-approval.php.

◆ $name

$name = 'entry_approval'

Definition at line 9 of file class-gravityview-field-approval.php.

◆ $search_operators

$search_operators = array( 'is', 'isnot' )

Definition at line 13 of file class-gravityview-field-approval.php.


The documentation for this class was generated from the following file: