GravityView_Entry_Approval_Status
There are specific values of entry approval that are valid. This class holds them and manages access to them.
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:23
Details
- Kind:
class - Namespace:
(global)
Methods
| Method | Description |
|---|---|
get_all() | Return array of status options |
get_values() | Get the status values as an array |
maybe_convert_status() | Convert previously-used values to the current values, for backward compatibility. |
is_valid() | Check whether the passed value is one of the defined values for entry approval |
is_approved() | |
is_disapproved() | |
is_unapproved() | |
get_labels() | Get the labels for the status choices |
get_label() | Get the label for a specific approval value |
get_action() | Get the label for a specific approval value |
get_string() | Get the label for a specific approval value |
get_title_attr() | Get the label for a specific approval value |
get_key() | Get the status key for a value |
Method Reference
get_all()
public static function get_all()
Return array of status options
Returns
array— Associative array of available statuses
See Also
GravityView_Entry_Approval_Status::get_choices
Source: includes/class-gravityview-entry-approval-status.php:96
get_values()
public static function get_values()
Get the status values as an array
Returns
array— Array of values for approval status choices
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:107
maybe_convert_status()
public static function maybe_convert_status( $old_value='' )
Convert previously-used values to the current values, for backward compatibility.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$old_value | string | '' | The status |
Returns
int— Status value (1for approved,2for disapproved, or3for unapproved).
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:125
is_valid()
public static function is_valid( $value=null )
Check whether the passed value is one of the defined values for entry approval
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | mixed | null |
Returns
bool— True: value is valid; false: value is not valid
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:172
is_approved()
public static function is_approved( $status )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$status | mixed | Value to check approval of |
Returns
bool— True: passed $status matches approved value
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:190
is_disapproved()
public static function is_disapproved( $status )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$status | mixed | Value to check approval of |
Returns
bool— True: passed $status matches disapproved value
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:204
is_unapproved()
public static function is_unapproved( $status )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$status | mixed | Value to check approval of |
Returns
bool— True: passed $status matches unapproved value
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:218
get_labels()
public static function get_labels()
Get the labels for the status choices
Returns
array— Array of labels for the status choices ("Approved", "Disapproved")
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:232
get_label()
public static function get_label( $value_or_key )
Get the label for a specific approval value
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value_or_key | int | string | Valid status value or key (1 or "approved") |
Returns
string|false— Label of value ("Approved"). If invalid value, return false.
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:286
get_action()
public static function get_action( $value_or_key )
Get the label for a specific approval value
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value_or_key | int | string | Valid status value or key (1 or "approved") |
Returns
string|false— Action of value (eg: "Reset Approval"). If invalid value, return false.
Since: 2.17
Source: includes/class-gravityview-entry-approval-status.php:299
get_string()
public static function get_string( $value_or_key, $string_key='' )
Get the label for a specific approval value
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value_or_key | int | string | Valid status value or key (1 or "approved") | |
$string_key | '' |
Returns
string|false— Label of value ("Approved"). If invalid value, return false.
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:312
get_title_attr()
public static function get_title_attr( $value_or_key )
Get the label for a specific approval value
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value_or_key | int | string | Valid status value or key (1 or "approved") |
Returns
string|false— Label of value ("Approved"). If invalid value, return false.
Since: 1.18
Source: includes/class-gravityview-entry-approval-status.php:325
get_key()
public static function get_key( $value )
Get the status key for a value
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | int | Status value (1, 2, 3) |
Returns
string|false— The status key at status $value, if exists. If not exists, false.
Source: includes/class-gravityview-entry-approval-status.php:336