12 if ( ! defined(
'WPINC' ) ) {
32 add_action(
'gravityview/metaboxes/delete_entry', array( $this,
'view_settings_metabox' ) );
35 add_action(
'gravityview/metaboxes/edit_entry', array( $this,
'view_settings_edit_entry_metabox' ), 20 );
38 add_filter(
'gravityview_field_visibility_caps', array( $this,
'modify_visibility_caps' ), 10, 5 );
41 add_filter(
'gravityview_template_delete_link_options', array( $this,
'delete_link_field_options' ), 10, 5 );
44 add_action(
'gravityview/metaboxes/delete_entry', array( $this,
'view_settings_delete_entry_metabox' ), 7 );
47 add_filter(
'gravityview_entry_default_fields', array( $this,
'add_default_field' ), 10, 3 );
95 $caps = $visibility_caps;
101 unset( $caps[
'publish_posts'], $caps[
'gravityforms_view_entries'], $caps[
'delete_others_posts'] );
103 $caps[
'read'] = _x(
'Entry Creator',
'User capability',
'gk-gravityview' );
126 unset( $field_options[
'show_as_link'], $field_options[
'search_filter'] );
129 unset( $field_options[
'only_loggedin'], $field_options[
'only_loggedin_cap'] );
131 $add_option[
'delete_link'] = array(
133 'label' => __(
'Delete Link Text',
'gk-gravityview' ),
135 'value' => __(
'Delete Entry',
'gk-gravityview' ),
136 'merge_tags' =>
true,
139 $field_options[
'allow_edit_cap'] = array(
141 'label' => __(
'Allow the following users to delete the entry:',
'gk-gravityview' ),
143 'tooltip' =>
'allow_edit_cap',
144 'class' =>
'widefat',
146 'group' =>
'visibility',
150 return array_merge( $add_option, $field_options );
166 $available_fields[
'delete_link'] = array(
167 'label_text' => __(
'Delete Entry',
'gk-gravityview' ),
168 'field_id' =>
'delete_link',
169 'label_type' =>
'field',
170 'input_type' =>
'delete_link',
171 'field_options' => null,
172 'icon' =>
'dashicons-trash',
175 return $available_fields;
207 if (
'edit' !== $zone ) {
208 $entry_default_fields[
'delete_link'] = array(
209 'label' => __(
'Delete Entry',
'gk-gravityview' ),
210 'type' =>
'delete_link',
211 'desc' => __(
'A link to delete the entry. Respects the Delete Entry permissions.',
'gk-gravityview' ),
212 'icon' =>
'dashicons-trash',
216 return $entry_default_fields;
view_settings_metabox( $current_settings)
Render Delete Entry View metabox settings.
static render_setting_row( $key='', $current_settings=array(), $override_input=null, $name='template_settings[%s]', $id='gravityview_se_%s')
Output a table row for view settings.
add_available_field( $available_fields=array())
Add Delete Entry Link to the Add Field dialog.
if(gravityview() ->plugin->is_GF_25()) $form
add_default_field( $entry_default_fields, $form=array(), $zone='')
Add Edit Link as a default field, outside those set in the Gravity Form form.
view_settings_delete_entry_metabox( $current_settings)
Render Delete Entry Permissions settings.
__construct(GravityView_Delete_Entry $loader)
delete_link_field_options( $field_options, $template_id, $field_id, $context, $input_type)
Add "Delete Link Text" setting to the edit_link field settings.
modify_visibility_caps( $visibility_caps=array(), $template_id='', $field_id='', $context='', $input_type='')
Change wording for the Edit context to read Entry Creator.
view_settings_edit_entry_metabox( $current_settings)
Renders settings relating to Delete Entry that should appear in the Edit Entry metabox.
static get_cap_choices( $template_id='', $field_id='', $context='', $input_type='')
Get capabilities options for GravityView.
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed