GF_Field_Post_Image
Source: includes/fields/class-gf-field-post-image.php:8
Details
- Kind:
class - Namespace:
(global) - Extends:
GF_Field_Fileupload
Methods
| Method | Description |
|---|---|
get_field_container_tag() | Returns the HTML tag for the field container. |
get_form_editor_field_description() | Returns the field's form editor description. |
get_form_editor_field_icon() | Returns the field's form editor icon. |
get_value_save_input() | Sanitize and format the value before it is saved to the Entry Object. |
get_value_entry_detail() | Format the entry value for display on the entry detail page and for the {all_fields} merge tag. |
get_value_merge_tag() | Gets merge tag values. |
get_extra_entry_metadata() | Stores the physical file paths as extra entry meta data. |
sanitize_settings() | Forces settings into expected values while saving the form object. |
post_convert_field() | Actions to be performed after the field has been converted to an object. |
Method Reference
get_field_container_tag()
public function get_field_container_tag( $form )
Returns the HTML tag for the field container.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The current Form object. |
Returns
string
Since: 2.5
Source: includes/fields/class-gf-field-post-image.php:21
get_form_editor_field_description()
public function get_form_editor_field_description()
Returns the field's form editor description.
Returns
string
Since: 2.5
Source: includes/fields/class-gf-field-post-image.php:42
get_form_editor_field_icon()
public function get_form_editor_field_icon()
Returns the field's form editor icon.
This could be an icon url or a gform-icon class.
Returns
string
Since: 2.5
Source: includes/fields/class-gf-field-post-image.php:55
get_value_save_input()
public function get_value_save_input( $value, $form, $input_name, $entry_id, $entry, $repeater_index='' )
Sanitize and format the value before it is saved to the Entry Object.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | 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 currently being processed. | |
$repeater_index | string | '' | The repeater index if the field is inside a repeater. |
Returns
array|string— The sanitized and formatted input value to be saved.
Since: 3.0.0
Source: includes/fields/class-gf-field-post-image.php:191
get_value_entry_detail()
public function get_value_entry_detail( $value, $entry=[], $use_text=false, $format='html', $media='screen' )
Format the entry value for display on the entry detail page and for the {all_fields} merge tag.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | array | The field value. | |
$entry | array | [] | The entry. |
$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
Since:
1.92.9.29(Changed the second parameter $currency (string) to $entry (array).)
Source: includes/fields/class-gf-field-post-image.php:248
get_value_merge_tag()
public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br )
Gets merge tag values.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | array | string | The value of the input. | |
$input_id | string | The input ID to use. | |
$entry | array | The Entry Object. | |
$form | array | The Form Object | |
$modifier | string | The modifier passed. | |
$raw_value | array | string | The raw value of the input. | |
$url_encode | bool | If the result should be URL encoded. | |
$esc_html | bool | If the HTML should be escaped. | |
$format | string | The format that the value should be. | |
$nl2br | bool | If the nl2br function should be used. |
Returns
string— The processed merge tag.
Since:
Unknown2.5(Add alt text.)
Source: includes/fields/class-gf-field-post-image.php:313
get_extra_entry_metadata()
public function get_extra_entry_metadata( $form, $entry )
Stores the physical file paths as extra entry meta data.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The form object being saved. | |
$entry | array | The entry object being saved. |
Returns
array— The array that contains the file URLs and their corresponding physical paths.
Since: 2.5.16
Source: includes/fields/class-gf-field-post-image.php:343
sanitize_settings()
public function sanitize_settings()
Forces settings into expected values while saving the form object.
Since: 2.10.0 (Added storageType property.)
Source: includes/fields/class-gf-field-post-image.php:358
post_convert_field()
public function post_convert_field()
Actions to be performed after the field has been converted to an object.
Since: 2.10.0
Source: includes/fields/class-gf-field-post-image.php:368