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

If this file is called directly, abort. More...

Static Public Member Functions

static get_all ()
 Return array of status options. More...
 
static get_key ($value)
 Get the status key for a value. More...
 
static get_label ($value_or_key)
 Get the label for a specific approval value. More...
 
static get_labels ()
 Get the labels for the status choices. More...
 
static get_string ($value_or_key, $string_key= '')
 Get the label for a specific approval value. More...
 
static get_title_attr ($value_or_key)
 Get the label for a specific approval value. More...
 
static get_values ()
 Get the status values as an array. More...
 
static is_approved ($status)
 
static is_disapproved ($status)
 
static is_unapproved ($status)
 
static is_valid ($value=NULL)
 Check whether the passed value is one of the defined values for entry approval. More...
 
static maybe_convert_status ($old_value= '')
 Convert previously-used values to the current values, for backward compatibility. More...
 

Data Fields

const APPROVED = 1
 
const DISAPPROVED = 2
 
const UNAPPROVED = 3
 

Private Member Functions

 __construct ()
 GravityView_Entry_Approval_Status constructor. More...
 

Static Private Member Functions

static choice_pluck ($status, $attr_key= '')
 Pluck a certain field value from a status array. More...
 
static get_choices ()
 Match values to the labels. More...
 

Detailed Description

If this file is called directly, abort.

There are specific values of entry approval that are valid. This class holds them and manages access to them.

Since
1.18

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

Constructor & Destructor Documentation

__construct ( )
private

Member Function Documentation

static choice_pluck (   $status,
  $attr_key = '' 
)
staticprivate

Pluck a certain field value from a status array.

Examples:

self::choice_pluck( 'disapproved', 'value' ); // Returns 2 self::choice_pluck( 'approved', 'label' ); // Returns Approved

Since
1.18
Parameters
int | string$statusValid status value or key (1 or "approved")
string$attr_keyKey name for the "value", "label", "action", "title". If "key", returns the matched key instead of value.
Returns
false|string False if match isn't not found

Definition at line 245 of file class-gravityview-entry-approval-status.php.

static get_all ( )
static

Return array of status options.

See also
GravityView_Entry_Approval_Status::get_choices
Returns
array Associative array of available statuses

Definition at line 82 of file class-gravityview-entry-approval-status.php.

Referenced by GravityView_Field_Entry_Approval\enqueue_and_localize_script().

static get_choices ( )
staticprivate

Match values to the labels.

Since
1.18
Returns
array

Definition at line 52 of file class-gravityview-entry-approval-status.php.

static get_key (   $value)
static

Get the status key for a value.

Parameters
int$valueStatus value (1, 2, 3)
Returns
string|false The status key at status $value, if exists. If not exists, false.

Definition at line 310 of file class-gravityview-entry-approval-status.php.

References $value.

Referenced by GravityView_Field_Is_Approved\filter_field_value(), GravityView_Field_Entry_Approval\get_css_class(), and GravityView_Entry_Approval\update_approved_meta().

static get_label (   $value_or_key)
static

Get the label for a specific approval value.

Since
1.18
Parameters
int | string$value_or_keyValid status value or key (1 or "approved")
Returns
string|false Label of value ("Approved"). If invalid value, return false.

Definition at line 273 of file class-gravityview-entry-approval-status.php.

Referenced by GravityView_Field_Is_Approved\field_options(), GravityView_Field_Is_Approved\filter_field_value(), GravityView_Admin_ApproveEntries\filter_links_entry_list(), and GravityView_Entry_Approval\get_entry_status().

static get_labels ( )
static

Get the labels for the status choices.

Since
1.18
Returns
array Array of labels for the status choices ("Approved", "Disapproved")

Definition at line 218 of file class-gravityview-entry-approval-status.php.

References $labels.

static get_string (   $value_or_key,
  $string_key = '' 
)
static

Get the label for a specific approval value.

Since
1.18
Parameters
int | string$value_or_keyValid status value or key (1 or "approved")
Returns
string|false Label of value ("Approved"). If invalid value, return false.

Definition at line 286 of file class-gravityview-entry-approval-status.php.

Referenced by GravityView_Field_Entry_Approval\get_anchor_text(), GravityView_Admin_ApproveEntries\get_bulk_actions(), and GravityView_Field_Entry_Approval\get_title_attr().

static get_title_attr (   $value_or_key)
static

Get the label for a specific approval value.

Since
1.18
Parameters
int | string$value_or_keyValid status value or key (1 or "approved")
Returns
string|false Label of value ("Approved"). If invalid value, return false.

Definition at line 299 of file class-gravityview-entry-approval-status.php.

Referenced by GravityView_Admin_ApproveEntries\add_scripts_and_styles().

static get_values ( )
static

Get the status values as an array.

Since
1.18
Returns
array Array of values for approval status choices

Definition at line 93 of file class-gravityview-entry-approval-status.php.

static is_approved (   $status)
static
Parameters
mixed$statusValue to check approval of
Since
1.18
Returns
bool True: passed $status matches approved value

Definition at line 176 of file class-gravityview-entry-approval-status.php.

Referenced by GravityView_frontend\is_entry_approved().

static is_disapproved (   $status)
static
Parameters
mixed$statusValue to check approval of
Since
1.18
Returns
bool True: passed $status matches disapproved value

Definition at line 190 of file class-gravityview-entry-approval-status.php.

static is_unapproved (   $status)
static
Parameters
mixed$statusValue to check approval of
Since
1.18
Returns
bool True: passed $status matches unapproved value

Definition at line 204 of file class-gravityview-entry-approval-status.php.

Referenced by GravityView_Entry_Approval\update_approved_meta().

static is_valid (   $value = NULL)
static

Check whether the passed value is one of the defined values for entry approval.

Since
1.18
Parameters
mixed$value
Returns
bool True: value is valid; false: value is not valid

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

References $value.

Referenced by GravityView_Entry_Approval\add_approval_status_updated_note(), GravityView_Entry_Approval\ajax_update_approved(), GravityView_Entry_Approval\update_approved(), GravityView_Entry_Approval\update_approved_meta(), and GravityView_Entry_Approval\update_bulk().

static maybe_convert_status (   $old_value = '')
static

Convert previously-used values to the current values, for backward compatibility.

Since
1.18
Parameters
string$old_valueThe status
Returns
int|string Current value, possibly converted from old value

Definition at line 111 of file class-gravityview-entry-approval-status.php.

Referenced by GravityView_Entry_Approval\add_approval_status_updated_note(), GravityView_Field_Is_Approved\filter_field_value(), GravityView_Entry_Approval\get_entry_status(), GravityView_Entry_Approval\update_approved(), and GravityView_Entry_Approval\update_approved_meta().

Field Documentation

const APPROVED = 1
const DISAPPROVED = 2
const UNAPPROVED = 3

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