GravityView  2.17
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_action ( $value_or_key)
 Get the label for a specific approval value. More...
 
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()

__construct ( )
private

Member Function Documentation

◆ choice_pluck()

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 246 of file class-gravityview-entry-approval-status.php.

◆ get_action()

static get_action (   $value_or_key)
static

Get the label for a specific approval value.

Since
2.17
Parameters
int | string$value_or_keyValid status value or key (1 or "approved")
Returns
string|false Action of value (eg: "Reset Approval"). If invalid value, return false.

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

Referenced by GravityView_Entry_Approval_Merge_Tags\replace_merge_tag().

◆ get_all()

static get_all ( )
static

◆ get_choices()

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.

◆ get_key()

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 323 of file class-gravityview-entry-approval-status.php.

References $value.

Referenced by GravityView_Entry_Approval_Merge_Tags\get_approval_status(), GravityView_Field_Entry_Approval\get_css_class(), GravityView_Field_Is_Approved\get_output(), and GravityView_Entry_Approval\update_approved_meta().

◆ get_label()

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_Admin_ApproveEntries\filter_links_entry_list(), GravityView_Entry_Approval\get_entry_status(), GravityView_Field_Is_Approved\get_output(), and GravityView_Entry_Approval_Merge_Tags\maybe_show_approval_notice().

◆ get_labels()

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 219 of file class-gravityview-entry-approval-status.php.

References $labels.

◆ get_string()

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 299 of file class-gravityview-entry-approval-status.php.

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

◆ 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 312 of file class-gravityview-entry-approval-status.php.

Referenced by GravityView_Admin_ApproveEntries\add_scripts_and_styles().

◆ get_values()

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 94 of file class-gravityview-entry-approval-status.php.

Referenced by GravityView_Entry_Approval_Merge_Tags\get_approval_status().

◆ is_approved()

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 177 of file class-gravityview-entry-approval-status.php.

Referenced by gvfield\callback(), gravityview\callback(), View\content(), Views_Route\get_sub_item_permissions_check(), GravityView_frontend\is_entry_approved(), and oEmbed\render_frontend().

◆ is_disapproved()

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 191 of file class-gravityview-entry-approval-status.php.

◆ is_unapproved()

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 205 of file class-gravityview-entry-approval-status.php.

◆ is_valid()

static is_valid (   $value = NULL)
static

◆ maybe_convert_status()

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 112 of file class-gravityview-entry-approval-status.php.

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

Field Documentation

◆ APPROVED

const APPROVED = 1

◆ DISAPPROVED

const DISAPPROVED = 2

◆ UNAPPROVED

const UNAPPROVED = 3

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