Skip to main content

Gravity_Flow_Field_Discussion

Class Gravity_Flow_Field_Discussion

Source: includes/fields/class-field-discussion.php:17

Details

Properties

PropertyTypeDescription
$typestringThe field type.

Methods

MethodDescription
add_button()Adds the Workflow Fields group to the form editor.
get_form_editor_button()Returns the field button properties for the form editor.
get_form_editor_field_settings()Returns the class names of the settings which should be available on the field in the form editor.
get_form_editor_field_title()Returns the field title.
get_value_entry_list()Return the entry value for display on the entries list page.
get_value_merge_tag()Return the entry value which will replace the field merge tag.
get_value_entry_detail()Return the entry value for display on the entry detail page and for the {all_fields} merge tag.
get_field_input()Returns the field inner markup.
format_discussion_value()Prepares the field entry value for output.
get_limit_modifier()Get the value of the limit modifier, if specified on the merge tag.
format_discussion_item()Format a single discussion item for output.
get_delete_button()Prepares the markup for the delete comment button when on the entry detail edit page.
format_comment_value()Formats an individual comment value for output in a location using the HTML format.
get_value_save_entry()Format the value for saving to the Entry Object.
get_value_export()Format the entry value before it is used in entry exports and by framework add-ons using GFAddOn::get_field_value().
sanitize_settings()Sanitize the field settings when the form is saved.
delete_discussion_item()Deletes the specified comment and updates the entry in the database.
ajax_delete_discussion_item()Target of the wp_ajax_gravityflow_delete_discussion_item hook; handles the ajax request to delete a comment.
delete_discussion_item_script()Target of the gform_entry_detail hook; includes the script for the delete comment link.
get_value_zapier_formatted()Returns a formatted version of the field value to be added to the Zapier request body.

Method Reference

add_button()

public function add_button( $field_groups )

Adds the Workflow Fields group to the form editor.

Parameters

NameTypeDefaultDescription
$field_groupsarrayThe properties for the field groups.

Returns

  • array

Source: includes/fields/class-field-discussion.php:42

get_form_editor_button()

public function get_form_editor_button()

Returns the field button properties for the form editor.

Returns

  • array

Source: includes/fields/class-field-discussion.php:53

get_form_editor_field_settings()

function get_form_editor_field_settings()

Returns the class names of the settings which should be available on the field in the form editor.

Returns

  • array

Source: includes/fields/class-field-discussion.php:65

get_form_editor_field_title()

public function get_form_editor_field_title()

Returns the field title.

Returns

  • string

Source: includes/fields/class-field-discussion.php:92

get_value_entry_list()

public function get_value_entry_list( $value, $entry, $field_id, $columns, $form )

Return the entry value for display on the entries list page.

Parameters

NameTypeDefaultDescription
$valuestring | arrayThe field value.
$entryarrayThe Entry Object currently being processed.
$field_idstringThe field or input ID currently being processed.
$columnsarrayThe properties for the columns being displayed on the entry list page.
$formarrayThe Form Object currently being processed.

Returns

  • string

Source: includes/fields/class-field-discussion.php:107

get_value_merge_tag()

public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br )

Return the entry value which will replace the field merge tag.

Parameters

NameTypeDefaultDescription
$valuestringThe field value. Depending on the location the merge tag is being used the following functions may have already been applied to the value: esc_html, nl2br, and urlencode.
$input_idstringThe field or input ID from the merge tag currently being processed.
$entryarrayThe Entry Object currently being processed.
$formarrayThe Form Object currently being processed.
$modifierstringThe merge tag modifier. e.g. value.
$raw_valuestring | arrayThe raw field value from before any formatting was applied to $value.
$url_encodeboolIndicates if the urlencode function may have been applied to the $value.
$esc_htmlboolIndicates if the esc_html function may have been applied to the $value.
$formatstringThe format requested for the location the merge is being used. Possible values: html, text or url.
$nl2brboolIndicates if the nl2br function may have been applied to the $value.

Returns

  • string

Source: includes/fields/class-field-discussion.php:136

get_value_entry_detail()

public function get_value_entry_detail( $value, $currency='', $use_text=false, $format='html', $media='screen' )

Return the entry value for display on the entry detail page and for the {all_fields} merge tag.

Parameters

NameTypeDefaultDescription
$valuestringThe field value.
$currencystring''The entry currency code.
$use_textbool | falsefalseWhen processing choice based fields should the choice text be returned instead of the value.
$formatstring'html'The format requested for the location the merge is being used. Possible values: html, text or url.
$mediastring'screen'The location where the value will be displayed. Possible values: screen or email.

Returns

  • string

Source: includes/fields/class-field-discussion.php:153

get_field_input()

public function get_field_input( $form, $value='', $entry=null )

Returns the field inner markup.

Parameters

NameTypeDefaultDescription
$formarrayThe Form Object currently being processed.
$valuestring | array''The field value. From default/dynamic population, $_POST, or a resumed incomplete submission.
$entrynull | arraynullNull or the Entry Object currently being edited.

Returns

  • string

Source: includes/fields/class-field-discussion.php:168

format_discussion_value()

public function format_discussion_value( $value, $format='html', $entry_id=null )

Prepares the field entry value for output.

Parameters

NameTypeDefaultDescription
$valuestringThe entry value for the current field.
$formatstring'html'The requested format for the value; html or text.
$entry_idint | nullnullThe ID of the entry currently being edited or null in other locations.

Returns

  • string

Since:

Source: includes/fields/class-field-discussion.php:211

get_limit_modifier()

public function get_limit_modifier()

Get the value of the limit modifier, if specified on the merge tag.

Returns

  • int — The number of comments to return or 0 to return them all.

Since: 1.7.1-dev

Source: includes/fields/class-field-discussion.php:329

format_discussion_item()

public function format_discussion_item( $item, $format, $entry_id )

Format a single discussion item for output.

Parameters

NameTypeDefaultDescription
$itemarrayThe properties of the item to be processed.
$formatstringThe requested format for the value; html or text.
$entry_idint | nullThe ID of the entry currently being edited or null in other locations.

Returns

  • string

Since: 1.7.1-dev

Source: includes/fields/class-field-discussion.php:347

get_delete_button()

public function get_delete_button( $item_id, $entry_id )

Prepares the markup for the delete comment button when on the entry detail edit page.

Parameters

NameTypeDefaultDescription
$item_idstringThe ID of the comment currently being processed.
$entry_idintThe ID of the entry currently being processed.

Returns

  • string

Since: 1.4.2-dev

Source: includes/fields/class-field-discussion.php:426

format_comment_value()

public function format_comment_value( $value )

Formats an individual comment value for output in a location using the HTML format.

Parameters

NameTypeDefaultDescription
$valuestringThe comment value.

Returns

  • string

Since: 1.4.2-dev

Source: includes/fields/class-field-discussion.php:446

get_value_save_entry()

public function get_value_save_entry( $value, $form, $input_name, $entry_id, $entry )

Format the value for saving to the Entry Object.

Parameters

NameTypeDefaultDescription
$valuearray | stringThe value to be saved.
$formarrayThe Form Object currently being processed.
$input_namestringThe input name used when accessing the $_POST.
$entry_idintThe ID of the Entry currently being processed.
$entryarrayThe Entry Object currently being processed.

Returns

  • string

Source: includes/fields/class-field-discussion.php:473

get_value_export()

public function get_value_export( $entry, $input_id='', $use_text=false, $is_csv=false )

Format the entry value before it is used in entry exports and by framework add-ons using GFAddOn::get_field_value().

Parameters

NameTypeDefaultDescription
$entryarrayThe entry currently being processed.
$input_idstring''The field or input ID.
$use_textbool | falsefalseWhen processing choice based fields should the choice text be returned instead of the value.
$is_csvbool | falsefalseIndicates if the value is going to be used in the .csv entries export.

Returns

  • string

Source: includes/fields/class-field-discussion.php:520

sanitize_settings()

public function sanitize_settings()

Sanitize the field settings when the form is saved.

Source: includes/fields/class-field-discussion.php:527

delete_discussion_item()

public function delete_discussion_item( $entry, $item_id )

Deletes the specified comment and updates the entry in the database.

Parameters

NameTypeDefaultDescription
$entryarrayThe entry containing the comment to be deleted.
$item_idstringThe ID of the comment to be deleted.

Returns

  • array | bool

Since: 1.4.2-dev

Source: includes/fields/class-field-discussion.php:544

ajax_delete_discussion_item()

public static function ajax_delete_discussion_item()

Target of the wp_ajax_gravityflow_delete_discussion_item hook; handles the ajax request to delete a comment.

Since: 1.4.2-dev

Source: includes/fields/class-field-discussion.php:574

delete_discussion_item_script()

public static function delete_discussion_item_script()

Target of the gform_entry_detail hook; includes the script for the delete comment link.

Since: 1.4.2-dev

Source: includes/fields/class-field-discussion.php:603

get_value_zapier_formatted()

public function get_value_zapier_formatted( $entry )

Returns a formatted version of the field value to be added to the Zapier request body.

Parameters

NameTypeDefaultDescription
$entryarrayThe entry being sent to Zapier.

Returns

  • array

Since: 2.7.5

Source: includes/fields/class-field-discussion.php:642