/** * Add "Delete Link Text" setting to the edit_link field settings * * @since 1.5.1 * @param [type] $field_options [description] * @param [type] $template_id [description] * @param [type] $field_id [description] * @param [type] $context [description] * @param [type] $input_type [description] * @return [type] [description] */ function delete_link_field_options($field_options, $template_id, $field_id, $context, $input_type) { // Always a link, never a filter unset($field_options['show_as_link'], $field_options['search_filter']); // Delete Entry link should only appear to visitors capable of editing entries unset($field_options['only_loggedin'], $field_options['only_loggedin_cap']); $add_option['delete_link'] = array('type' => 'text', 'label' => __('Delete Link Text', 'gravityview'), 'desc' => NULL, 'value' => __('Delete Entry', 'gravityview'), 'merge_tags' => true); $field_options['allow_edit_cap'] = array('type' => 'select', 'label' => __('Allow the following users to delete the entry:', 'gravityview'), 'choices' => GravityView_Render_Settings::get_cap_choices($template_id, $field_id, $context, $input_type), 'tooltip' => 'allow_edit_cap', 'class' => 'widefat', 'value' => 'read'); return array_merge($add_option, $field_options); }
/** * Manipulate the fields' options for the EDIT ENTRY screen * @param [type] $field_options [description] * @param [type] $template_id [description] * @param [type] $field_id [description] * @param [type] $context [description] * @param [type] $input_type [description] * @return [type] [description] */ function field_options($field_options, $template_id, $field_id, $context, $input_type) { // We only want to modify the settings for the edit context if ('edit' !== $context) { /** * @since 1.8.4 */ $field_options['new_window'] = array('type' => 'checkbox', 'label' => __('Open link in a new tab or window?', 'gravityview'), 'value' => false); return $field_options; } // Entry field is only for logged in users unset($field_options['only_loggedin'], $field_options['only_loggedin_cap']); $add_options = array('allow_edit_cap' => array('type' => 'select', 'label' => __('Make field editable to:', 'gravityview'), 'choices' => GravityView_Render_Settings::get_cap_choices($template_id, $field_id, $context, $input_type), 'tooltip' => 'allow_edit_cap', 'class' => 'widefat', 'value' => 'read')); return array_merge($field_options, $add_options); }