Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../public_h.../wp-conte.../plugins/wpforms-.../includes/fields
File: class-base.php
',
[1000] Fix | Delete
wpforms_validate_field_id( $field['id'] ),
[1001] Fix | Delete
esc_html__( 'General', 'wpforms-lite' ),
[1002] Fix | Delete
esc_html( $this->name ),
[1003] Fix | Delete
esc_attr( $class )
[1004] Fix | Delete
);
[1005] Fix | Delete
[1006] Fix | Delete
} else {
[1007] Fix | Delete
$output = '</div></div>';
[1008] Fix | Delete
}
[1009] Fix | Delete
break;
[1010] Fix | Delete
[1011] Fix | Delete
/*
[1012] Fix | Delete
* Field Label.
[1013] Fix | Delete
*/
[1014] Fix | Delete
case 'label':
[1015] Fix | Delete
$value = ! empty( $field['label'] ) ? esc_html( $field['label'] ) : '';
[1016] Fix | Delete
$tooltip = ! empty( $args['tooltip'] ) ? $args['tooltip'] : esc_html__( 'Enter text for the form field label. Field labels are recommended and can be hidden in the Advanced Settings.', 'wpforms-lite' );
[1017] Fix | Delete
[1018] Fix | Delete
$output = $this->field_element(
[1019] Fix | Delete
'label',
[1020] Fix | Delete
$field,
[1021] Fix | Delete
[
[1022] Fix | Delete
'slug' => 'label',
[1023] Fix | Delete
'value' => esc_html__( 'Label', 'wpforms-lite' ),
[1024] Fix | Delete
'tooltip' => $tooltip,
[1025] Fix | Delete
],
[1026] Fix | Delete
false
[1027] Fix | Delete
);
[1028] Fix | Delete
[1029] Fix | Delete
$output .= $this->field_element(
[1030] Fix | Delete
'text',
[1031] Fix | Delete
$field,
[1032] Fix | Delete
[
[1033] Fix | Delete
'slug' => 'label',
[1034] Fix | Delete
'value' => $value,
[1035] Fix | Delete
],
[1036] Fix | Delete
false
[1037] Fix | Delete
);
[1038] Fix | Delete
[1039] Fix | Delete
$output = $this->field_element(
[1040] Fix | Delete
'row',
[1041] Fix | Delete
$field,
[1042] Fix | Delete
[
[1043] Fix | Delete
'slug' => 'label',
[1044] Fix | Delete
'content' => $output,
[1045] Fix | Delete
],
[1046] Fix | Delete
false
[1047] Fix | Delete
);
[1048] Fix | Delete
break;
[1049] Fix | Delete
[1050] Fix | Delete
/*
[1051] Fix | Delete
* Field Description.
[1052] Fix | Delete
*/
[1053] Fix | Delete
case 'description':
[1054] Fix | Delete
$value = ! empty( $field['description'] ) ? esc_html( $field['description'] ) : '';
[1055] Fix | Delete
$tooltip = esc_html__( 'Enter text for the form field description.', 'wpforms-lite' );
[1056] Fix | Delete
[1057] Fix | Delete
$output = $this->field_element(
[1058] Fix | Delete
'label',
[1059] Fix | Delete
$field,
[1060] Fix | Delete
[
[1061] Fix | Delete
'slug' => 'description',
[1062] Fix | Delete
'value' => esc_html__( 'Description', 'wpforms-lite' ),
[1063] Fix | Delete
'tooltip' => $tooltip,
[1064] Fix | Delete
],
[1065] Fix | Delete
false
[1066] Fix | Delete
);
[1067] Fix | Delete
[1068] Fix | Delete
$output .= $this->field_element(
[1069] Fix | Delete
'textarea',
[1070] Fix | Delete
$field,
[1071] Fix | Delete
[
[1072] Fix | Delete
'slug' => 'description',
[1073] Fix | Delete
'value' => $value,
[1074] Fix | Delete
],
[1075] Fix | Delete
false
[1076] Fix | Delete
);
[1077] Fix | Delete
[1078] Fix | Delete
$output = $this->field_element(
[1079] Fix | Delete
'row',
[1080] Fix | Delete
$field,
[1081] Fix | Delete
[
[1082] Fix | Delete
'slug' => 'description',
[1083] Fix | Delete
'content' => $output,
[1084] Fix | Delete
],
[1085] Fix | Delete
false
[1086] Fix | Delete
);
[1087] Fix | Delete
break;
[1088] Fix | Delete
[1089] Fix | Delete
/*
[1090] Fix | Delete
* Field Required toggle.
[1091] Fix | Delete
*/
[1092] Fix | Delete
case 'required':
[1093] Fix | Delete
$default = ! empty( $args['default'] ) ? $args['default'] : '0';
[1094] Fix | Delete
$value = isset( $field['required'] ) ? esc_attr( $field['required'] ) : esc_attr( $default );
[1095] Fix | Delete
$tooltip = esc_html__( 'Check this option to mark the field required. A form will not submit unless all required fields are provided.', 'wpforms-lite' );
[1096] Fix | Delete
[1097] Fix | Delete
$output = $this->field_element(
[1098] Fix | Delete
'toggle',
[1099] Fix | Delete
$field,
[1100] Fix | Delete
[
[1101] Fix | Delete
'slug' => 'required',
[1102] Fix | Delete
'value' => $value,
[1103] Fix | Delete
'desc' => esc_html__( 'Required', 'wpforms-lite' ),
[1104] Fix | Delete
'tooltip' => $tooltip,
[1105] Fix | Delete
],
[1106] Fix | Delete
false
[1107] Fix | Delete
);
[1108] Fix | Delete
[1109] Fix | Delete
$output = $this->field_element(
[1110] Fix | Delete
'row',
[1111] Fix | Delete
$field,
[1112] Fix | Delete
[
[1113] Fix | Delete
'slug' => 'required',
[1114] Fix | Delete
'content' => $output,
[1115] Fix | Delete
],
[1116] Fix | Delete
false
[1117] Fix | Delete
);
[1118] Fix | Delete
break;
[1119] Fix | Delete
[1120] Fix | Delete
/*
[1121] Fix | Delete
* Field Meta (field type and ID).
[1122] Fix | Delete
*/
[1123] Fix | Delete
case 'meta':
[1124] Fix | Delete
_deprecated_argument( __CLASS__ . '::' . __METHOD__ . '( [ \'slug\' => \'meta\' ] )', '1.7.1 of the WPForms plugin' );
[1125] Fix | Delete
[1126] Fix | Delete
$output = sprintf( '<label>%s</label>', esc_html__( 'Type', 'wpforms-lite' ) );
[1127] Fix | Delete
[1128] Fix | Delete
$output .= sprintf(
[1129] Fix | Delete
'<p class="meta">%s <span class="id">(ID #%s)</span></p>',
[1130] Fix | Delete
esc_attr( $this->name ),
[1131] Fix | Delete
wpforms_validate_field_id( $field['id'] )
[1132] Fix | Delete
);
[1133] Fix | Delete
[1134] Fix | Delete
$output = $this->field_element(
[1135] Fix | Delete
'row',
[1136] Fix | Delete
$field,
[1137] Fix | Delete
[
[1138] Fix | Delete
'slug' => 'meta',
[1139] Fix | Delete
'content' => $output,
[1140] Fix | Delete
],
[1141] Fix | Delete
false
[1142] Fix | Delete
);
[1143] Fix | Delete
break;
[1144] Fix | Delete
[1145] Fix | Delete
/*
[1146] Fix | Delete
* Code Block.
[1147] Fix | Delete
*/
[1148] Fix | Delete
case 'code':
[1149] Fix | Delete
$value = ! empty( $field['code'] ) ? esc_textarea( $field['code'] ) : '';
[1150] Fix | Delete
$tooltip = esc_html__( 'Enter code for the form field.', 'wpforms-lite' );
[1151] Fix | Delete
[1152] Fix | Delete
$output = $this->field_element(
[1153] Fix | Delete
'label',
[1154] Fix | Delete
$field,
[1155] Fix | Delete
[
[1156] Fix | Delete
'slug' => 'code',
[1157] Fix | Delete
'value' => esc_html__( 'Code', 'wpforms-lite' ),
[1158] Fix | Delete
'tooltip' => $tooltip,
[1159] Fix | Delete
],
[1160] Fix | Delete
false
[1161] Fix | Delete
);
[1162] Fix | Delete
[1163] Fix | Delete
$output .= $this->field_element(
[1164] Fix | Delete
'textarea',
[1165] Fix | Delete
$field,
[1166] Fix | Delete
[
[1167] Fix | Delete
'slug' => 'code',
[1168] Fix | Delete
'value' => $value,
[1169] Fix | Delete
],
[1170] Fix | Delete
false
[1171] Fix | Delete
);
[1172] Fix | Delete
[1173] Fix | Delete
$output = $this->field_element(
[1174] Fix | Delete
'row',
[1175] Fix | Delete
$field,
[1176] Fix | Delete
[
[1177] Fix | Delete
'slug' => 'code',
[1178] Fix | Delete
'content' => $output,
[1179] Fix | Delete
],
[1180] Fix | Delete
false
[1181] Fix | Delete
);
[1182] Fix | Delete
break;
[1183] Fix | Delete
[1184] Fix | Delete
/*
[1185] Fix | Delete
* Choices.
[1186] Fix | Delete
*/
[1187] Fix | Delete
case 'choices':
[1188] Fix | Delete
$values = ! empty( $field['choices'] ) ? $field['choices'] : $this->defaults;
[1189] Fix | Delete
$label = ! empty( $args['label'] ) ? esc_html( $args['label'] ) : esc_html__( 'Choices', 'wpforms-lite' );
[1190] Fix | Delete
$class = [];
[1191] Fix | Delete
$field_type = $this->type;
[1192] Fix | Delete
$inline_style = '';
[1193] Fix | Delete
[1194] Fix | Delete
if ( ! empty( $field['multiple'] ) ) {
[1195] Fix | Delete
$field_type = 'checkbox';
[1196] Fix | Delete
}
[1197] Fix | Delete
[1198] Fix | Delete
if ( ! empty( $field['show_values'] ) ) {
[1199] Fix | Delete
$class[] = 'show-values';
[1200] Fix | Delete
}
[1201] Fix | Delete
[1202] Fix | Delete
if ( ! empty( $field['dynamic_choices'] ) ) {
[1203] Fix | Delete
$class[] = 'wpforms-hidden';
[1204] Fix | Delete
}
[1205] Fix | Delete
[1206] Fix | Delete
if ( ! empty( $field['choices_images'] ) ) {
[1207] Fix | Delete
$class[] = 'show-images';
[1208] Fix | Delete
}
[1209] Fix | Delete
[1210] Fix | Delete
if ( ! empty( $field['choices_icons'] ) ) {
[1211] Fix | Delete
$class[] = 'show-icons';
[1212] Fix | Delete
$icon_color = isset( $field['choices_icons_color'] ) ? wpforms_sanitize_hex_color( $field['choices_icons_color'] ) : '';
[1213] Fix | Delete
$icon_color = empty( $icon_color ) ? IconChoices::get_default_color() : $icon_color;
[1214] Fix | Delete
$inline_style = "--wpforms-icon-choices-color: {$icon_color};";
[1215] Fix | Delete
}
[1216] Fix | Delete
[1217] Fix | Delete
// Field label.
[1218] Fix | Delete
$lbl = $this->field_element(
[1219] Fix | Delete
'label',
[1220] Fix | Delete
$field,
[1221] Fix | Delete
[
[1222] Fix | Delete
'slug' => 'choices',
[1223] Fix | Delete
'value' => $label,
[1224] Fix | Delete
'tooltip' => esc_html__( 'Add choices for the form field.', 'wpforms-lite' ),
[1225] Fix | Delete
'after_tooltip' => '<a href="#" class="toggle-bulk-add-display toggle-unfoldable-cont"><i class="fa fa-download"></i><span>' . esc_html__( 'Bulk Add', 'wpforms-lite' ) . '</span></a>',
[1226] Fix | Delete
],
[1227] Fix | Delete
false
[1228] Fix | Delete
);
[1229] Fix | Delete
[1230] Fix | Delete
// Field contents.
[1231] Fix | Delete
$fld = sprintf(
[1232] Fix | Delete
'<ul data-next-id="%s" class="choices-list %s" data-field-id="%s" data-field-type="%s" style="%s">',
[1233] Fix | Delete
max( array_keys( $values ) ) + 1,
[1234] Fix | Delete
wpforms_sanitize_classes( $class, true ),
[1235] Fix | Delete
wpforms_validate_field_id( $field['id'] ),
[1236] Fix | Delete
esc_attr( $this->type ),
[1237] Fix | Delete
esc_attr( $inline_style )
[1238] Fix | Delete
);
[1239] Fix | Delete
[1240] Fix | Delete
foreach ( $values as $key => $value ) {
[1241] Fix | Delete
$default = ! empty( $value['default'] ) ? $value['default'] : '';
[1242] Fix | Delete
$base = sprintf( 'fields[%s][choices][%d]', wpforms_validate_field_id( $field['id'] ), absint( $key ) );
[1243] Fix | Delete
$label = isset( $value['label'] ) ? $value['label'] : '';
[1244] Fix | Delete
$image = ! empty( $value['image'] ) ? $value['image'] : '';
[1245] Fix | Delete
$hide_image_btn = false;
[1246] Fix | Delete
$icon = isset( $value['icon'] ) && ! wpforms_is_empty_string( $value['icon'] ) ? $value['icon'] : IconChoices::DEFAULT_ICON;
[1247] Fix | Delete
$icon_style = ! empty( $value['icon_style'] ) ? $value['icon_style'] : IconChoices::DEFAULT_ICON_STYLE;
[1248] Fix | Delete
[1249] Fix | Delete
$fld .= '<li data-key="' . absint( $key ) . '">';
[1250] Fix | Delete
[1251] Fix | Delete
$fld .= sprintf(
[1252] Fix | Delete
'<input type="%s" name="%s[default]" class="default" value="1" %s>',
[1253] Fix | Delete
$field_type === 'checkbox' ? 'checkbox' : 'radio',
[1254] Fix | Delete
esc_attr( $base ),
[1255] Fix | Delete
checked( '1', $default, false )
[1256] Fix | Delete
);
[1257] Fix | Delete
$fld .= '<span class="move"><i class="fa fa-bars"></i></span>';
[1258] Fix | Delete
$fld .= sprintf(
[1259] Fix | Delete
'<input type="text" name="%s[label]" value="%s" class="label">',
[1260] Fix | Delete
esc_attr( $base ),
[1261] Fix | Delete
esc_attr( $label )
[1262] Fix | Delete
);
[1263] Fix | Delete
$fld .= '<a class="add" href="#"><i class="fa fa-plus-circle"></i></a><a class="remove" href="#"><i class="fa fa-minus-circle"></i></a>';
[1264] Fix | Delete
$fld .= sprintf(
[1265] Fix | Delete
'<input type="text" name="%s[value]" value="%s" class="value">',
[1266] Fix | Delete
esc_attr( $base ),
[1267] Fix | Delete
esc_attr( ! isset( $value['value'] ) ? '' : $value['value'] )
[1268] Fix | Delete
);
[1269] Fix | Delete
$fld .= '<div class="wpforms-image-upload">';
[1270] Fix | Delete
$fld .= '<div class="preview">';
[1271] Fix | Delete
[1272] Fix | Delete
if ( ! empty( $image ) ) {
[1273] Fix | Delete
$fld .= sprintf(
[1274] Fix | Delete
'<img src="%s"><a href="#" title="%s" class="wpforms-image-upload-remove"><i class="fa fa-trash-o"></i></a>',
[1275] Fix | Delete
esc_url_raw( $image ),
[1276] Fix | Delete
esc_attr__( 'Remove Image', 'wpforms-lite' )
[1277] Fix | Delete
);
[1278] Fix | Delete
[1279] Fix | Delete
$hide_image_btn = true;
[1280] Fix | Delete
}
[1281] Fix | Delete
[1282] Fix | Delete
$fld .= '</div>';
[1283] Fix | Delete
$fld .= sprintf(
[1284] Fix | Delete
'<button class="wpforms-btn wpforms-btn-sm wpforms-btn-blue wpforms-btn-block wpforms-image-upload-add" data-after-upload="hide"%s>%s</button>',
[1285] Fix | Delete
$hide_image_btn ? ' style="display:none;"' : '',
[1286] Fix | Delete
esc_html__( 'Upload Image', 'wpforms-lite' )
[1287] Fix | Delete
);
[1288] Fix | Delete
$fld .= sprintf(
[1289] Fix | Delete
'<input type="hidden" name="%s[image]" value="%s" class="source">',
[1290] Fix | Delete
esc_attr( $base ),
[1291] Fix | Delete
esc_url_raw( $image )
[1292] Fix | Delete
);
[1293] Fix | Delete
$fld .= '</div>';
[1294] Fix | Delete
[1295] Fix | Delete
$fld .= sprintf(
[1296] Fix | Delete
'<div class="wpforms-icon-select">
[1297] Fix | Delete
<i class="ic-fa-preview ic-fa-%1$s ic-fa-%2$s"></i>
[1298] Fix | Delete
<span>%2$s</span>
[1299] Fix | Delete
<i class="fa fa-edit"></i>
[1300] Fix | Delete
<input type="hidden" name="%3$s[icon]" value="%2$s" class="source-icon">
[1301] Fix | Delete
<input type="hidden" name="%3$s[icon_style]" value="%1$s" class="source-icon-style">
[1302] Fix | Delete
</div>',
[1303] Fix | Delete
esc_attr( $icon_style ),
[1304] Fix | Delete
esc_attr( $icon ),
[1305] Fix | Delete
esc_attr( $base )
[1306] Fix | Delete
);
[1307] Fix | Delete
[1308] Fix | Delete
$fld .= '</li>';
[1309] Fix | Delete
}
[1310] Fix | Delete
$fld .= '</ul>';
[1311] Fix | Delete
[1312] Fix | Delete
// Field note: dynamic status.
[1313] Fix | Delete
$source = '';
[1314] Fix | Delete
$type = '';
[1315] Fix | Delete
$dynamic = ! empty( $field['dynamic_choices'] ) ? esc_html( $field['dynamic_choices'] ) : '';
[1316] Fix | Delete
[1317] Fix | Delete
if ( $dynamic === 'post_type' && ! empty( $field[ 'dynamic_' . $dynamic ] ) ) {
[1318] Fix | Delete
$type = esc_html__( 'post type', 'wpforms-lite' );
[1319] Fix | Delete
$pt = get_post_type_object( $field[ 'dynamic_' . $dynamic ] );
[1320] Fix | Delete
$source = '';
[1321] Fix | Delete
[1322] Fix | Delete
if ( $pt !== null ) {
[1323] Fix | Delete
$source = $pt->labels->name;
[1324] Fix | Delete
}
[1325] Fix | Delete
} elseif ( $dynamic === 'taxonomy' && ! empty( $field[ 'dynamic_' . $dynamic ] ) ) {
[1326] Fix | Delete
$type = esc_html__( 'taxonomy', 'wpforms-lite' );
[1327] Fix | Delete
$tax = get_taxonomy( $field[ 'dynamic_' . $dynamic ] );
[1328] Fix | Delete
$source = '';
[1329] Fix | Delete
[1330] Fix | Delete
if ( $tax !== false ) {
[1331] Fix | Delete
$source = $tax->labels->name;
[1332] Fix | Delete
}
[1333] Fix | Delete
}
[1334] Fix | Delete
[1335] Fix | Delete
$note = sprintf(
[1336] Fix | Delete
'<div class="wpforms-alert-warning wpforms-alert %s">',
[1337] Fix | Delete
! empty( $dynamic ) && ! empty( $field[ 'dynamic_' . $dynamic ] ) ? '' : 'wpforms-hidden'
[1338] Fix | Delete
);
[1339] Fix | Delete
[1340] Fix | Delete
$note .= '<h4>' . esc_html__( 'Dynamic Choices Active', 'wpforms-lite' ) . '</h4>';
[1341] Fix | Delete
[1342] Fix | Delete
$note .= sprintf(
[1343] Fix | Delete
/* translators: %1$s - source name, %2$s - type name. */
[1344] Fix | Delete
'<p>' . esc_html__( 'Choices are dynamically populated from the %1$s %2$s. Go to the Advanced tab to change this.', 'wpforms-lite' ) . '</p>',
[1345] Fix | Delete
'<span class="dynamic-name">' . esc_html( $source ) . '</span>',
[1346] Fix | Delete
'<span class="dynamic-type">' . esc_html( $type ) . '</span>'
[1347] Fix | Delete
);
[1348] Fix | Delete
$note .= '</div>';
[1349] Fix | Delete
[1350] Fix | Delete
// Final field output.
[1351] Fix | Delete
$output = $this->field_element(
[1352] Fix | Delete
'row',
[1353] Fix | Delete
$field,
[1354] Fix | Delete
[
[1355] Fix | Delete
'slug' => 'choices',
[1356] Fix | Delete
'content' => $lbl . $fld . $note,
[1357] Fix | Delete
],
[1358] Fix | Delete
false
[1359] Fix | Delete
);
[1360] Fix | Delete
break;
[1361] Fix | Delete
[1362] Fix | Delete
/*
[1363] Fix | Delete
* Choices for payments.
[1364] Fix | Delete
*/
[1365] Fix | Delete
case 'choices_payments':
[1366] Fix | Delete
$values = ! empty( $field['choices'] ) ? $field['choices'] : $this->defaults;
[1367] Fix | Delete
$class = [];
[1368] Fix | Delete
$input_type = in_array( $field['type'], [ 'payment-multiple', 'payment-select' ], true ) ? 'radio' : 'checkbox';
[1369] Fix | Delete
$inline_style = '';
[1370] Fix | Delete
[1371] Fix | Delete
if ( ! empty( $field['choices_images'] ) ) {
[1372] Fix | Delete
$class[] = 'show-images';
[1373] Fix | Delete
}
[1374] Fix | Delete
[1375] Fix | Delete
if ( ! empty( $field['choices_icons'] ) ) {
[1376] Fix | Delete
$class[] = 'show-icons';
[1377] Fix | Delete
$icon_color = isset( $field['choices_icons_color'] ) ? wpforms_sanitize_hex_color( $field['choices_icons_color'] ) : '';
[1378] Fix | Delete
$icon_color = empty( $icon_color ) ? IconChoices::get_default_color() : $icon_color;
[1379] Fix | Delete
$inline_style = "--wpforms-icon-choices-color: {$icon_color};";
[1380] Fix | Delete
}
[1381] Fix | Delete
[1382] Fix | Delete
// Field label.
[1383] Fix | Delete
$lbl = $this->field_element(
[1384] Fix | Delete
'label',
[1385] Fix | Delete
$field,
[1386] Fix | Delete
[
[1387] Fix | Delete
'slug' => 'choices',
[1388] Fix | Delete
'value' => esc_html__( 'Items', 'wpforms-lite' ),
[1389] Fix | Delete
'tooltip' => esc_html__( 'Add choices for the form field.', 'wpforms-lite' ),
[1390] Fix | Delete
],
[1391] Fix | Delete
false
[1392] Fix | Delete
);
[1393] Fix | Delete
[1394] Fix | Delete
// Field contents.
[1395] Fix | Delete
$fld = sprintf(
[1396] Fix | Delete
'<ul data-next-id="%s" class="choices-list %s" data-field-id="%s" data-field-type="%s" style="%s">',
[1397] Fix | Delete
max( array_keys( $values ) ) + 1,
[1398] Fix | Delete
wpforms_sanitize_classes( $class, true ),
[1399] Fix | Delete
wpforms_validate_field_id( $field['id'] ),
[1400] Fix | Delete
esc_attr( $this->type ),
[1401] Fix | Delete
esc_attr( $inline_style )
[1402] Fix | Delete
);
[1403] Fix | Delete
[1404] Fix | Delete
foreach ( $values as $key => $value ) {
[1405] Fix | Delete
$default = ! empty( $value['default'] ) ? $value['default'] : '';
[1406] Fix | Delete
$base = sprintf( 'fields[%s][choices][%d]', wpforms_validate_field_id( $field['id'] ), absint( $key ) );
[1407] Fix | Delete
$image = ! empty( $value['image'] ) ? $value['image'] : '';
[1408] Fix | Delete
$hide_image_btn = false;
[1409] Fix | Delete
$icon = isset( $value['icon'] ) && ! wpforms_is_empty_string( $value['icon'] ) ? $value['icon'] : IconChoices::DEFAULT_ICON;
[1410] Fix | Delete
$icon_style = ! empty( $value['icon_style'] ) ? $value['icon_style'] : IconChoices::DEFAULT_ICON_STYLE;
[1411] Fix | Delete
[1412] Fix | Delete
$fld .= '<li data-key="' . absint( $key ) . '">';
[1413] Fix | Delete
$fld .= sprintf(
[1414] Fix | Delete
'<input type="%s" name="%s[default]" class="default" value="1" %s>',
[1415] Fix | Delete
esc_attr( $input_type ),
[1416] Fix | Delete
esc_attr( $base ),
[1417] Fix | Delete
checked( '1', $default, false )
[1418] Fix | Delete
);
[1419] Fix | Delete
$fld .= '<span class="move"><i class="fa fa-bars"></i></span>';
[1420] Fix | Delete
$fld .= sprintf(
[1421] Fix | Delete
'<input type="text" name="%s[label]" value="%s" class="label">',
[1422] Fix | Delete
esc_attr( $base ),
[1423] Fix | Delete
esc_attr( $value['label'] )
[1424] Fix | Delete
);
[1425] Fix | Delete
$fld .= sprintf(
[1426] Fix | Delete
'<input type="text" name="%s[value]" value="%s" class="value wpforms-money-input" placeholder="%s">',
[1427] Fix | Delete
esc_attr( $base ),
[1428] Fix | Delete
esc_attr( wpforms_format_amount( wpforms_sanitize_amount( $value['value'] ) ) ),
[1429] Fix | Delete
wpforms_format_amount( 0 )
[1430] Fix | Delete
);
[1431] Fix | Delete
$fld .= '<a class="add" href="#"><i class="fa fa-plus-circle"></i></a><a class="remove" href="#"><i class="fa fa-minus-circle"></i></a>';
[1432] Fix | Delete
$fld .= '<div class="wpforms-image-upload">';
[1433] Fix | Delete
$fld .= '<div class="preview">';
[1434] Fix | Delete
[1435] Fix | Delete
if ( ! empty( $image ) ) {
[1436] Fix | Delete
$fld .= sprintf(
[1437] Fix | Delete
'<img src="%s"><a href="#" title="%s" class="wpforms-image-upload-remove"><i class="fa fa-trash-o"></i></a>',
[1438] Fix | Delete
esc_url_raw( $image ),
[1439] Fix | Delete
esc_attr__( 'Remove Image', 'wpforms-lite' )
[1440] Fix | Delete
);
[1441] Fix | Delete
[1442] Fix | Delete
$hide_image_btn = true;
[1443] Fix | Delete
}
[1444] Fix | Delete
[1445] Fix | Delete
$fld .= '</div>';
[1446] Fix | Delete
$fld .= sprintf(
[1447] Fix | Delete
'<button class="wpforms-btn wpforms-btn-sm wpforms-btn-blue wpforms-btn-block wpforms-image-upload-add" data-after-upload="hide"%s>%s</button>',
[1448] Fix | Delete
$hide_image_btn ? ' style="display:none;"' : '',
[1449] Fix | Delete
esc_html__( 'Upload Image', 'wpforms-lite' )
[1450] Fix | Delete
);
[1451] Fix | Delete
$fld .= sprintf(
[1452] Fix | Delete
'<input type="hidden" name="%s[image]" value="%s" class="source">',
[1453] Fix | Delete
$base,
[1454] Fix | Delete
esc_url_raw( $image )
[1455] Fix | Delete
);
[1456] Fix | Delete
$fld .= '</div>';
[1457] Fix | Delete
[1458] Fix | Delete
$fld .= sprintf(
[1459] Fix | Delete
'<div class="wpforms-icon-select">
[1460] Fix | Delete
<i class="ic-fa-preview ic-fa-%1$s ic-fa-%2$s""></i>
[1461] Fix | Delete
<span>%2$s</span>
[1462] Fix | Delete
<i class="fa fa-edit"></i>
[1463] Fix | Delete
<input type="hidden" name="%3$s[icon]" value="%2$s" class="source-icon">
[1464] Fix | Delete
<input type="hidden" name="%3$s[icon_style]" value="%1$s" class="source-icon-style">
[1465] Fix | Delete
</div>',
[1466] Fix | Delete
esc_attr( $icon_style ),
[1467] Fix | Delete
esc_attr( $icon ),
[1468] Fix | Delete
esc_attr( $base )
[1469] Fix | Delete
);
[1470] Fix | Delete
[1471] Fix | Delete
$fld .= '</li>';
[1472] Fix | Delete
}
[1473] Fix | Delete
$fld .= '</ul>';
[1474] Fix | Delete
[1475] Fix | Delete
// Final field output.
[1476] Fix | Delete
$output = $this->field_element(
[1477] Fix | Delete
'row',
[1478] Fix | Delete
$field,
[1479] Fix | Delete
[
[1480] Fix | Delete
'slug' => 'choices',
[1481] Fix | Delete
'content' => $lbl . $fld,
[1482] Fix | Delete
],
[1483] Fix | Delete
false
[1484] Fix | Delete
);
[1485] Fix | Delete
break;
[1486] Fix | Delete
[1487] Fix | Delete
/*
[1488] Fix | Delete
* Choices Images.
[1489] Fix | Delete
*/
[1490] Fix | Delete
case 'choices_images':
[1491] Fix | Delete
// Field note: Image tips.
[1492] Fix | Delete
$note = sprintf(
[1493] Fix | Delete
'<div class="wpforms-alert-warning wpforms-alert %s">',
[1494] Fix | Delete
! empty( $field['choices_images'] ) ? '' : 'wpforms-hidden'
[1495] Fix | Delete
);
[1496] Fix | Delete
$note .= wp_kses(
[1497] Fix | Delete
__( '<h4>Images are not cropped or resized.</h4><p>For best results, they should be the same size and 250x250 pixels or smaller.</p>', 'wpforms-lite' ),
[1498] Fix | Delete
[
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function