Gravity_Flow_Field_Discussion
Class Gravity_Flow_Field_Discussion
Source: includes/fields/class-field-discussion.php:17
Details
- Kind:
class - Namespace:
(global) - Extends: GF_Field_Textarea
Properties
| Property | Type | Description |
|---|---|---|
$type | string | The field type. |
Methods
| Method | Description |
|---|---|
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
| Name | Type | Default | Description |
|---|---|---|---|
$field_groups | array | The 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
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | array | The field value. | |
$entry | array | The Entry Object currently being processed. | |
$field_id | string | The field or input ID currently being processed. | |
$columns | array | The properties for the columns being displayed on the entry list page. | |
$form | array | The 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
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The 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_id | string | The field or input ID from the merge tag currently being processed. | |
$entry | array | The Entry Object currently being processed. | |
$form | array | The Form Object currently being processed. | |
$modifier | string | The merge tag modifier. e.g. value. | |
$raw_value | string | array | The raw field value from before any formatting was applied to $value. | |
$url_encode | bool | Indicates if the urlencode function may have been applied to the $value. | |
$esc_html | bool | Indicates if the esc_html function may have been applied to the $value. | |
$format | string | The format requested for the location the merge is being used. Possible values: html, text or url. | |
$nl2br | bool | Indicates 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
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The field value. | |
$currency | string | '' | The entry currency code. |
$use_text | bool | false | false | When processing choice based fields should the choice text be returned instead of the value. |
$format | string | 'html' | The format requested for the location the merge is being used. Possible values: html, text or url. |
$media | string | '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
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The Form Object currently being processed. | |
$value | string | array | '' | The field value. From default/dynamic population, $_POST, or a resumed incomplete submission. |
$entry | null | array | null | Null 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
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The entry value for the current field. | |
$format | string | 'html' | The requested format for the value; html or text. |
$entry_id | int | null | null | The 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
| Name | Type | Default | Description |
|---|---|---|---|
$item | array | The properties of the item to be processed. | |
$format | string | The requested format for the value; html or text. | |
$entry_id | int | null | The 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
| Name | Type | Default | Description |
|---|---|---|---|
$item_id | string | The ID of the comment currently being processed. | |
$entry_id | int | The 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
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The 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
| Name | Type | Default | Description |
|---|---|---|---|
$value | array | string | The value to be saved. | |
$form | array | The Form Object currently being processed. | |
$input_name | string | The input name used when accessing the $_POST. | |
$entry_id | int | The ID of the Entry currently being processed. | |
$entry | array | The 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
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The entry currently being processed. | |
$input_id | string | '' | The field or input ID. |
$use_text | bool | false | false | When processing choice based fields should the choice text be returned instead of the value. |
$is_csv | bool | false | false | Indicates 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
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The entry containing the comment to be deleted. | |
$item_id | string | The 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
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The entry being sent to Zapier. |
Returns
array
Since: 2.7.5
Source: includes/fields/class-field-discussion.php:642