38 public $icon =
'dashicons-yes-alt';
42 $this->label = esc_html__(
'Approval Status',
'gk-gravityview' );
43 $this->
description = esc_html__(
'Display the entry\'s current approval status.',
'gk-gravityview' );
44 $this->default_search_label = __(
'Approval:',
'gk-gravityview' );
48 parent::__construct();
52 add_filter(
'gravityview_entry_default_fields', array( $this,
'add_default_field' ), 10, 3 );
71 $field_setting_key = sprintf(
'%s_label', $status_key );
84 return sprintf(
'<span class="gv-approval-%s">%s</span>', esc_attr( $status_key ),
$value );
100 if(
'edit' !== $zone ) {
102 'label' => $this->label,
104 'type' => $this->name,
108 return $entry_default_fields;
125 'label' => __(
'Approval Status',
'gk-gravityview'),
126 'tag' =>
'{approval_status}' 149 public function replace_merge_tag( $matches = array(), $text =
'',
$form = array(),
$entry = array(), $url_encode =
false, $esc_html =
false ) {
159 foreach ( $matches as $match ) {
162 gravityview()->log->error(
'No entry data available. Returning empty string.' );
168 $return = str_replace( $match[0], $replacement, $return );
176 $field_options[
'approved_label'] = array(
178 'label' => __(
'Approved Label',
'gk-gravityview' ),
179 'desc' => __(
'If the entry is approved, display this value',
'gk-gravityview' ),
183 $field_options[
'disapproved_label'] = array(
185 'label' => __(
'Disapproved Label',
'gk-gravityview' ),
186 'desc' => __(
'If the entry is not approved, display this value',
'gk-gravityview' ),
190 $field_options[
'unapproved_label'] = array(
192 'label' => __(
'Unapproved Label',
'gk-gravityview' ),
193 'desc' => __(
'If the entry has not yet been approved or disapproved, display this value',
'gk-gravityview' ),
197 return $field_options;
Modify field settings by extending this class.
replace_merge_tag( $matches=array(), $text='', $form=array(), $entry=array(), $url_encode=false, $esc_html=false)
Run GravityView filters when using GFCommon::replace_variables()
$field_settings['content']
static get_key( $value)
Get the status key for a value.
new GravityView_Field_Is_Approved
if(gravityview() ->plugin->is_GF_25()) $form
scale description p description
add_default_field( $entry_default_fields, $form, $zone)
static maybe_convert_status( $old_value='')
Convert previously-used values to the current values, for backward compatibility. ...
$entry_meta_is_default_column
field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id)
static get_entry_status( $entry, $value_or_label='label')
Get the approval status for an entry.
static get_output( $approval_status='', $field_settings=array(), $html=false)
Convert entry approval status value to label in the field output.
if(empty( $created_by)) $form_id
static get( $array, $key, $default=null)
Grab a value from an array or an object or default.
gravityview()
The main GravityView wrapper function.
custom_merge_tags( $form=array(), $fields=array())
Add custom merge tags to merge tag options.
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed
static get_label( $value_or_key)
Get the label for a specific approval value.