Edit File by line
/home/zeestwma/ceyloniy.../wp-conte.../plugins/wpforms-.../includes/fields
File: class-base.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// phpcs:disable Generic.Commenting.DocComment.MissingShort
[2] Fix | Delete
/** @noinspection AutoloadingIssuesInspection */
[3] Fix | Delete
/** @noinspection PhpIllegalPsrClassPathInspection */
[4] Fix | Delete
// phpcs:enable Generic.Commenting.DocComment.MissingShort
[5] Fix | Delete
[6] Fix | Delete
use WPForms\Forms\Fields\Base\Frontend as FrontendBase;
[7] Fix | Delete
use WPForms\Forms\Fields\Helpers\RequirementsAlerts;
[8] Fix | Delete
use WPForms\Forms\Fields\Traits\MultiFieldMenu as MultiFieldMenuTrait;
[9] Fix | Delete
use WPForms\Forms\Fields\Traits\ReadOnlyField as ReadOnlyFieldTrait;
[10] Fix | Delete
use WPForms\Forms\IconChoices;
[11] Fix | Delete
use WPForms\Integrations\AI\Helpers as AIHelpers;
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Base field template.
[15] Fix | Delete
*
[16] Fix | Delete
* @since 1.0.0
[17] Fix | Delete
*/
[18] Fix | Delete
abstract class WPForms_Field {
[19] Fix | Delete
[20] Fix | Delete
use MultiFieldMenuTrait;
[21] Fix | Delete
use ReadOnlyFieldTrait;
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Common default field settings.
[25] Fix | Delete
*
[26] Fix | Delete
* @since 1.9.4
[27] Fix | Delete
*
[28] Fix | Delete
* @var array
[29] Fix | Delete
*/
[30] Fix | Delete
private const COMMON_DEFAULT_SETTINGS = [
[31] Fix | Delete
'id' => 0,
[32] Fix | Delete
'type' => '',
[33] Fix | Delete
'label' => '',
[34] Fix | Delete
'description' => '',
[35] Fix | Delete
'size' => 'medium',
[36] Fix | Delete
'default_value' => '',
[37] Fix | Delete
'css' => '',
[38] Fix | Delete
'read_only' => 0,
[39] Fix | Delete
];
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* Full name of the field type, e.g. "Paragraph Text".
[43] Fix | Delete
*
[44] Fix | Delete
* @since 1.0.0
[45] Fix | Delete
*
[46] Fix | Delete
* @var string
[47] Fix | Delete
*/
[48] Fix | Delete
public $name;
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* Type of the field, eg "textarea".
[52] Fix | Delete
*
[53] Fix | Delete
* @since 1.0.0
[54] Fix | Delete
*
[55] Fix | Delete
* @var string
[56] Fix | Delete
*/
[57] Fix | Delete
public $type;
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Font Awesome Icon used for the editor button, e.g. "fa-list".
[61] Fix | Delete
*
[62] Fix | Delete
* @since 1.0.0
[63] Fix | Delete
*
[64] Fix | Delete
* @var mixed
[65] Fix | Delete
*/
[66] Fix | Delete
public $icon = false;
[67] Fix | Delete
[68] Fix | Delete
/**
[69] Fix | Delete
* Field keywords for search, e.g. "checkbox, file, icon, upload".
[70] Fix | Delete
*
[71] Fix | Delete
* @since 1.8.3
[72] Fix | Delete
*
[73] Fix | Delete
* @var string
[74] Fix | Delete
*/
[75] Fix | Delete
public $keywords = '';
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* Priority order the field button should show inside the "Add Fields" tab.
[79] Fix | Delete
*
[80] Fix | Delete
* @since 1.0.0
[81] Fix | Delete
*
[82] Fix | Delete
* @var int
[83] Fix | Delete
*/
[84] Fix | Delete
public $order = 1;
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* Field group the field belongs to.
[88] Fix | Delete
*
[89] Fix | Delete
* @since 1.0.0
[90] Fix | Delete
*
[91] Fix | Delete
* @var string
[92] Fix | Delete
*/
[93] Fix | Delete
public $group = 'standard';
[94] Fix | Delete
[95] Fix | Delete
/**
[96] Fix | Delete
* Placeholder to hold default value(s) for some field types.
[97] Fix | Delete
*
[98] Fix | Delete
* @since 1.0.0
[99] Fix | Delete
*
[100] Fix | Delete
* @var mixed
[101] Fix | Delete
*/
[102] Fix | Delete
public $defaults;
[103] Fix | Delete
[104] Fix | Delete
/**
[105] Fix | Delete
* Default field settings.
[106] Fix | Delete
*
[107] Fix | Delete
* @since 1.9.4
[108] Fix | Delete
*
[109] Fix | Delete
* @var mixed
[110] Fix | Delete
*/
[111] Fix | Delete
public $default_settings;
[112] Fix | Delete
[113] Fix | Delete
/**
[114] Fix | Delete
* Current form ID in the admin builder.
[115] Fix | Delete
*
[116] Fix | Delete
* @since 1.1.1
[117] Fix | Delete
*
[118] Fix | Delete
* @var int|false
[119] Fix | Delete
*/
[120] Fix | Delete
public $form_id;
[121] Fix | Delete
[122] Fix | Delete
/**
[123] Fix | Delete
* Current field ID.
[124] Fix | Delete
*
[125] Fix | Delete
* @since 1.5.6
[126] Fix | Delete
*
[127] Fix | Delete
* @var int
[128] Fix | Delete
*/
[129] Fix | Delete
public $field_id;
[130] Fix | Delete
[131] Fix | Delete
/**
[132] Fix | Delete
* Current form data.
[133] Fix | Delete
*
[134] Fix | Delete
* @since 1.1.1
[135] Fix | Delete
*
[136] Fix | Delete
* @var array
[137] Fix | Delete
*/
[138] Fix | Delete
public $form_data;
[139] Fix | Delete
[140] Fix | Delete
/**
[141] Fix | Delete
* Current field data.
[142] Fix | Delete
*
[143] Fix | Delete
* @since 1.5.6
[144] Fix | Delete
*
[145] Fix | Delete
* @var array
[146] Fix | Delete
*/
[147] Fix | Delete
public $field_data;
[148] Fix | Delete
[149] Fix | Delete
/**
[150] Fix | Delete
* Instance of the Frontend class.
[151] Fix | Delete
*
[152] Fix | Delete
* @since 1.8.1
[153] Fix | Delete
*
[154] Fix | Delete
* @var FrontendBase
[155] Fix | Delete
*/
[156] Fix | Delete
protected $frontend_obj;
[157] Fix | Delete
[158] Fix | Delete
/**
[159] Fix | Delete
* Primary class constructor.
[160] Fix | Delete
*
[161] Fix | Delete
* @since 1.0.0
[162] Fix | Delete
*
[163] Fix | Delete
* @param bool $init Pass false to allow shortcutting the whole initialization, if needed.
[164] Fix | Delete
*/
[165] Fix | Delete
public function __construct( $init = true ) { // phpcs:ignore WPForms.PHP.HooksMethod.InvalidPlaceForAddingHooks
[166] Fix | Delete
[167] Fix | Delete
if ( ! $init ) {
[168] Fix | Delete
return;
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification
[172] Fix | Delete
$this->form_id = false;
[173] Fix | Delete
[174] Fix | Delete
if ( isset( $_GET['form_id'] ) ) {
[175] Fix | Delete
$this->form_id = absint( $_GET['form_id'] );
[176] Fix | Delete
} elseif ( isset( $_POST['id'] ) ) {
[177] Fix | Delete
$this->form_id = absint( $_POST['id'] );
[178] Fix | Delete
}
[179] Fix | Delete
// phpcs:enable WordPress.Security.NonceVerification
[180] Fix | Delete
[181] Fix | Delete
// Bootstrap.
[182] Fix | Delete
$this->init();
[183] Fix | Delete
$this->read_only_init();
[184] Fix | Delete
[185] Fix | Delete
// Init field default settings.
[186] Fix | Delete
$this->field_default_settings();
[187] Fix | Delete
[188] Fix | Delete
// Initialize a field's Frontend class.
[189] Fix | Delete
$this->frontend_obj = $this->get_object( 'Frontend' );
[190] Fix | Delete
[191] Fix | Delete
// Common field hooks.
[192] Fix | Delete
$this->common_hooks();
[193] Fix | Delete
}
[194] Fix | Delete
[195] Fix | Delete
/**
[196] Fix | Delete
* Common field hooks.
[197] Fix | Delete
*
[198] Fix | Delete
* @since 1.9.4
[199] Fix | Delete
*/
[200] Fix | Delete
protected function common_hooks(): void { // phpcs:ignore WPForms.PHP.HooksMethod.InvalidPlaceForAddingHooks
[201] Fix | Delete
[202] Fix | Delete
// Solution to get an object of the field class.
[203] Fix | Delete
add_filter(
[204] Fix | Delete
"wpforms_fields_get_field_object_{$this->type}",
[205] Fix | Delete
function () {
[206] Fix | Delete
return $this;
[207] Fix | Delete
}
[208] Fix | Delete
);
[209] Fix | Delete
[210] Fix | Delete
// Field data.
[211] Fix | Delete
add_filter( 'wpforms_field_new_default', [ $this, 'field_new_default' ] );
[212] Fix | Delete
[213] Fix | Delete
// Field data.
[214] Fix | Delete
add_filter( 'wpforms_field_data', [ $this, 'field_data' ], 10, 2 );
[215] Fix | Delete
[216] Fix | Delete
// Add fields tab.
[217] Fix | Delete
add_filter( 'wpforms_builder_fields_buttons', [ $this, 'field_button' ], 15 );
[218] Fix | Delete
[219] Fix | Delete
// Add field keywords to the template fields.
[220] Fix | Delete
add_filter( 'wpforms_setup_template_fields', [ $this, 'enhance_template_fields_with_keywords' ] );
[221] Fix | Delete
[222] Fix | Delete
// Field options tab.
[223] Fix | Delete
add_action( "wpforms_builder_fields_options_{$this->type}", [ $this, 'field_options' ] );
[224] Fix | Delete
[225] Fix | Delete
// Preview fields.
[226] Fix | Delete
add_action( "wpforms_builder_fields_previews_{$this->type}", [ $this, 'field_preview' ] );
[227] Fix | Delete
[228] Fix | Delete
// AJAX Add new field.
[229] Fix | Delete
add_action( "wp_ajax_wpforms_new_field_{$this->type}", [ $this, 'field_new' ] );
[230] Fix | Delete
[231] Fix | Delete
// Display field input elements on the front-end.
[232] Fix | Delete
add_action( "wpforms_display_field_{$this->type}", [ $this, 'field_display_proxy' ], 10, 3 );
[233] Fix | Delete
[234] Fix | Delete
// Display field on the back-end.
[235] Fix | Delete
add_filter( "wpforms_pro_admin_entries_edit_is_field_displayable_{$this->type}", '__return_true', 9 );
[236] Fix | Delete
[237] Fix | Delete
// Validation on submitting.
[238] Fix | Delete
add_action( "wpforms_process_validate_{$this->type}", [ $this, 'validate' ], 10, 3 );
[239] Fix | Delete
[240] Fix | Delete
// Format.
[241] Fix | Delete
add_action( "wpforms_process_format_{$this->type}", [ $this, 'format' ], 10, 3 );
[242] Fix | Delete
[243] Fix | Delete
// Prefill.
[244] Fix | Delete
add_filter( 'wpforms_field_properties', [ $this, 'field_prefill_value_property' ], 10, 3 );
[245] Fix | Delete
[246] Fix | Delete
// Change the choice's value while saving entries.
[247] Fix | Delete
add_filter( 'wpforms_process_before_form_data', [ $this, 'field_fill_empty_choices' ] );
[248] Fix | Delete
[249] Fix | Delete
// Change the field name for ajax error.
[250] Fix | Delete
add_filter( 'wpforms_process_ajax_error_field_name', [ $this, 'ajax_error_field_name' ], 10, 4 );
[251] Fix | Delete
[252] Fix | Delete
// Add HTML line breaks before all newlines in Entry Preview.
[253] Fix | Delete
add_filter( "wpforms_pro_fields_entry_preview_get_field_value_{$this->type}_field_after", 'nl2br', 100 );
[254] Fix | Delete
[255] Fix | Delete
// Add allowed HTML tags for the field label.
[256] Fix | Delete
add_filter( 'wpforms_builder_strings', [ $this, 'add_allowed_label_html_tags' ] );
[257] Fix | Delete
[258] Fix | Delete
// Exclude empty dynamic choices from Entry Preview.
[259] Fix | Delete
add_filter( 'wpforms_pro_fields_entry_preview_print_entry_preview_exclude_field', [ $this, 'exclude_empty_dynamic_choices' ], 10, 3 );
[260] Fix | Delete
[261] Fix | Delete
// Add classes to the builder field preview.
[262] Fix | Delete
add_filter( 'wpforms_field_preview_class', [ $this, 'preview_field_class' ], 10, 2 );
[263] Fix | Delete
}
[264] Fix | Delete
[265] Fix | Delete
/**
[266] Fix | Delete
* All systems go. Used by subclasses. Required.
[267] Fix | Delete
*
[268] Fix | Delete
* @since 1.0.0
[269] Fix | Delete
* @since 1.5.0 Converted to abstract method, as it's required for all fields.
[270] Fix | Delete
*/
[271] Fix | Delete
abstract public function init();
[272] Fix | Delete
[273] Fix | Delete
/**
[274] Fix | Delete
* Prefill the field value with either fallback or dynamic data.
[275] Fix | Delete
* This needs to be public (although internal) to be used in WordPress hooks.
[276] Fix | Delete
*
[277] Fix | Delete
* @since 1.5.0
[278] Fix | Delete
*
[279] Fix | Delete
* @param array $properties Field properties.
[280] Fix | Delete
* @param array $field Current field specific data.
[281] Fix | Delete
* @param array $form_data Prepared form data/settings.
[282] Fix | Delete
*
[283] Fix | Delete
* @return array Modified field properties.
[284] Fix | Delete
*/
[285] Fix | Delete
public function field_prefill_value_property( $properties, $field, $form_data ) {
[286] Fix | Delete
[287] Fix | Delete
// Process only for the current field.
[288] Fix | Delete
if ( $this->type !== $field['type'] ) {
[289] Fix | Delete
return $properties;
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
// Set the form data, so we can reuse it later, even on the front-end.
[293] Fix | Delete
$this->form_data = $form_data;
[294] Fix | Delete
[295] Fix | Delete
// Dynamic data.
[296] Fix | Delete
if ( ! empty( $this->form_data['settings']['dynamic_population'] ) ) {
[297] Fix | Delete
$properties = $this->field_prefill_value_property_dynamic( $properties, $field );
[298] Fix | Delete
}
[299] Fix | Delete
[300] Fix | Delete
// Fallback data rewrites the dynamic because user-submitted data is more important.
[301] Fix | Delete
return $this->field_prefill_value_property_fallback( $properties, $field );
[302] Fix | Delete
}
[303] Fix | Delete
[304] Fix | Delete
/**
[305] Fix | Delete
* As we are processing user submitted data - ignore all admin-defined defaults.
[306] Fix | Delete
* Preprocess choice-related fields only.
[307] Fix | Delete
*
[308] Fix | Delete
* @since 1.5.0
[309] Fix | Delete
*
[310] Fix | Delete
* @param array $field Field data and settings.
[311] Fix | Delete
* @param array $properties Properties we are modifying.
[312] Fix | Delete
*/
[313] Fix | Delete
public function field_prefill_remove_choices_defaults( $field, &$properties ): void {
[314] Fix | Delete
[315] Fix | Delete
// Skip this step on the admin page.
[316] Fix | Delete
if ( is_admin() && ! wpforms_is_admin_page( 'entries', 'edit' ) ) {
[317] Fix | Delete
return;
[318] Fix | Delete
}
[319] Fix | Delete
[320] Fix | Delete
if (
[321] Fix | Delete
! empty( $field['dynamic_choices'] ) ||
[322] Fix | Delete
! empty( $field['choices'] )
[323] Fix | Delete
) {
[324] Fix | Delete
array_walk_recursive(
[325] Fix | Delete
$properties['inputs'],
[326] Fix | Delete
static function ( &$value, $key ) {
[327] Fix | Delete
[328] Fix | Delete
if ( $key === 'default' ) {
[329] Fix | Delete
$value = false;
[330] Fix | Delete
}
[331] Fix | Delete
if ( $value === 'wpforms-selected' ) {
[332] Fix | Delete
$value = '';
[333] Fix | Delete
}
[334] Fix | Delete
}
[335] Fix | Delete
);
[336] Fix | Delete
}
[337] Fix | Delete
}
[338] Fix | Delete
[339] Fix | Delete
/**
[340] Fix | Delete
* Whether the current field can be populated dynamically.
[341] Fix | Delete
*
[342] Fix | Delete
* @since 1.5.0
[343] Fix | Delete
*
[344] Fix | Delete
* @param array $properties Field properties.
[345] Fix | Delete
* @param array $field Current field specific data.
[346] Fix | Delete
*
[347] Fix | Delete
* @return bool
[348] Fix | Delete
*/
[349] Fix | Delete
public function is_dynamic_population_allowed( $properties, $field ) {
[350] Fix | Delete
[351] Fix | Delete
$allowed = true;
[352] Fix | Delete
[353] Fix | Delete
// Allow the population on the front-end only.
[354] Fix | Delete
if ( is_admin() ) {
[355] Fix | Delete
$allowed = false;
[356] Fix | Delete
}
[357] Fix | Delete
[358] Fix | Delete
// For dynamic population we require $_GET.
[359] Fix | Delete
if ( empty( $_GET ) ) { // phpcs:ignore
[360] Fix | Delete
$allowed = false;
[361] Fix | Delete
}
[362] Fix | Delete
[363] Fix | Delete
/**
[364] Fix | Delete
* Filters whether the current field can be populated dynamically.
[365] Fix | Delete
*
[366] Fix | Delete
* @since 1.5.0
[367] Fix | Delete
*
[368] Fix | Delete
* @param bool $allowed Whether the current field can be populated dynamically.
[369] Fix | Delete
* @param array $properties Field properties.
[370] Fix | Delete
* @param array $field Field data.
[371] Fix | Delete
*/
[372] Fix | Delete
return (bool) apply_filters( 'wpforms_field_is_dynamic_population_allowed', $allowed, $properties, $field );
[373] Fix | Delete
}
[374] Fix | Delete
[375] Fix | Delete
/**
[376] Fix | Delete
* Prefill the field value with a dynamic value that we get from $_GET.
[377] Fix | Delete
* The pattern is: wpf4_12_primary, where:
[378] Fix | Delete
* 4 - form_id,
[379] Fix | Delete
* 12 - field_id,
[380] Fix | Delete
* first - input key.
[381] Fix | Delete
* As 'primary' is our default input key, "wpf4_12_primary" and "wpf4_12" are the same.
[382] Fix | Delete
*
[383] Fix | Delete
* @since 1.5.0
[384] Fix | Delete
*
[385] Fix | Delete
* @param array $properties Field properties.
[386] Fix | Delete
* @param array $field Current field specific data.
[387] Fix | Delete
*
[388] Fix | Delete
* @return array Modified field properties.
[389] Fix | Delete
*/
[390] Fix | Delete
protected function field_prefill_value_property_dynamic( $properties, $field ) {
[391] Fix | Delete
[392] Fix | Delete
if ( ! $this->is_dynamic_population_allowed( $properties, $field ) ) {
[393] Fix | Delete
return $properties;
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
// Iterate over each GET key, parse, and scrap data from there.
[397] Fix | Delete
foreach ( $_GET as $key => $raw_value ) { // phpcs:ignore
[398] Fix | Delete
preg_match( '/wpf(\d+)_(\d+)(.*)/i', $key, $matches );
[399] Fix | Delete
[400] Fix | Delete
if ( empty( $matches ) || ! is_array( $matches ) ) {
[401] Fix | Delete
continue;
[402] Fix | Delete
}
[403] Fix | Delete
[404] Fix | Delete
// Required.
[405] Fix | Delete
$form_id = absint( $matches[1] );
[406] Fix | Delete
$field_id = absint( $matches[2] );
[407] Fix | Delete
$input = 'primary';
[408] Fix | Delete
[409] Fix | Delete
// Optional.
[410] Fix | Delete
if ( ! empty( $matches[3] ) ) {
[411] Fix | Delete
$input = sanitize_key( trim( $matches[3], '_' ) );
[412] Fix | Delete
}
[413] Fix | Delete
[414] Fix | Delete
// Both form and field IDs should be the same as the current form / field.
[415] Fix | Delete
if (
[416] Fix | Delete
(int) $this->form_data['id'] !== $form_id ||
[417] Fix | Delete
(int) $field['id'] !== $field_id
[418] Fix | Delete
) {
[419] Fix | Delete
// Go to the next GET param.
[420] Fix | Delete
continue;
[421] Fix | Delete
}
[422] Fix | Delete
[423] Fix | Delete
if ( ! empty( $raw_value ) ) {
[424] Fix | Delete
$this->field_prefill_remove_choices_defaults( $field, $properties );
[425] Fix | Delete
[426] Fix | Delete
if (
[427] Fix | Delete
is_string( $raw_value ) &&
[428] Fix | Delete
in_array(
[429] Fix | Delete
$field['type'],
[430] Fix | Delete
wpforms_get_multi_fields(),
[431] Fix | Delete
true
[432] Fix | Delete
)
[433] Fix | Delete
) {
[434] Fix | Delete
$raw_value = explode( '|', rawurldecode( $raw_value ) );
[435] Fix | Delete
}
[436] Fix | Delete
}
[437] Fix | Delete
[438] Fix | Delete
/*
[439] Fix | Delete
* Some fields (like checkboxes) support multiple selection.
[440] Fix | Delete
* We do not support nested values, so omit them.
[441] Fix | Delete
* Example: ?wpf771_19_wpforms[fields][19][address1]=test
[442] Fix | Delete
* In this case:
[443] Fix | Delete
* $input = wpforms
[444] Fix | Delete
* $raw_value = [fields=>[]]
[445] Fix | Delete
* $single_value = [19=>[]]
[446] Fix | Delete
* There is no reliable way to clean those things out.
[447] Fix | Delete
* So we will ignore the value altogether if it's an array.
[448] Fix | Delete
* We support only single value numeric arrays, like these:
[449] Fix | Delete
* ?wpf771_19[]=test1&wpf771_19[]=test2
[450] Fix | Delete
* ?wpf771_19_value[]=test1&wpf771_19_value[]=test2
[451] Fix | Delete
* ?wpf771_41_r3_c2[]=1&wpf771_41_r1_c4[]=1
[452] Fix | Delete
* We support also pipe-separated values like this:
[453] Fix | Delete
* ?wpf771_19=test1|test2
[454] Fix | Delete
*/
[455] Fix | Delete
if ( is_array( $raw_value ) ) {
[456] Fix | Delete
foreach ( $raw_value as $single_value ) {
[457] Fix | Delete
$properties = $this->get_field_populated_single_property_value( $single_value, $input, $properties, $field );
[458] Fix | Delete
}
[459] Fix | Delete
} else {
[460] Fix | Delete
$properties = $this->get_field_populated_single_property_value( $raw_value, $input, $properties, $field );
[461] Fix | Delete
}
[462] Fix | Delete
}
[463] Fix | Delete
[464] Fix | Delete
return $properties;
[465] Fix | Delete
}
[466] Fix | Delete
[467] Fix | Delete
/**
[468] Fix | Delete
* Public version of get_field_populated_single_property_value() to use by external classes.
[469] Fix | Delete
*
[470] Fix | Delete
* @since 1.6.0.1
[471] Fix | Delete
*
[472] Fix | Delete
* @param string $raw_value Value from a GET param, always a string.
[473] Fix | Delete
* @param string $input Represent a subfield inside the field. Maybe empty.
[474] Fix | Delete
* @param array $properties Field properties.
[475] Fix | Delete
* @param array $field Current field specific data.
[476] Fix | Delete
*
[477] Fix | Delete
* @return array Modified field properties.
[478] Fix | Delete
*/
[479] Fix | Delete
public function get_field_populated_single_property_value_public( $raw_value, $input, $properties, $field ) {
[480] Fix | Delete
[481] Fix | Delete
return $this->get_field_populated_single_property_value( $raw_value, $input, $properties, $field );
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
/**
[485] Fix | Delete
* Get the value used to prefill via dynamic or fallback population.
[486] Fix | Delete
* Based on field data and current properties.
[487] Fix | Delete
*
[488] Fix | Delete
* @since 1.5.0
[489] Fix | Delete
*
[490] Fix | Delete
* @param string $raw_value Value from a GET param, always a string.
[491] Fix | Delete
* @param string $input Represent a subfield inside the field. Maybe empty.
[492] Fix | Delete
* @param array $properties Field properties.
[493] Fix | Delete
* @param array $field Current field specific data.
[494] Fix | Delete
*
[495] Fix | Delete
* @return array Modified field properties.
[496] Fix | Delete
*/
[497] Fix | Delete
protected function get_field_populated_single_property_value( $raw_value, $input, $properties, $field ) {
[498] Fix | Delete
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function