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.../httpdocs/clone/wp-conte.../plugins/wpforms-.../includes/fields
File: class-radio.php
printf(
[500] Fix | Delete
'<label %s>%s</label>',
[501] Fix | Delete
wpforms_html_attributes( $choice['label']['id'], $choice['label']['class'], $choice['label']['data'], $choice['label']['attr'] ),
[502] Fix | Delete
wp_kses_post( $label )
[503] Fix | Delete
);
[504] Fix | Delete
}
[505] Fix | Delete
[506] Fix | Delete
echo '</li>';
[507] Fix | Delete
}
[508] Fix | Delete
[509] Fix | Delete
echo '</ul>';
[510] Fix | Delete
}
[511] Fix | Delete
[512] Fix | Delete
/**
[513] Fix | Delete
* Validate field.
[514] Fix | Delete
*
[515] Fix | Delete
* @since 1.8.2
[516] Fix | Delete
*
[517] Fix | Delete
* @param int $field_id Field ID.
[518] Fix | Delete
* @param string|array $field_submit Submitted field value (raw data).
[519] Fix | Delete
* @param array $form_data Form data and settings.
[520] Fix | Delete
*/
[521] Fix | Delete
public function validate( $field_id, $field_submit, $form_data ) {
[522] Fix | Delete
[523] Fix | Delete
$field = $form_data['fields'][ $field_id ];
[524] Fix | Delete
[525] Fix | Delete
// Skip validation if field is dynamic and choices are empty.
[526] Fix | Delete
if ( $this->is_dynamic_choices_empty( $field, $form_data ) ) {
[527] Fix | Delete
return;
[528] Fix | Delete
}
[529] Fix | Delete
[530] Fix | Delete
parent::validate( $field_id, $field_submit, $form_data );
[531] Fix | Delete
}
[532] Fix | Delete
[533] Fix | Delete
/**
[534] Fix | Delete
* Format and sanitize field.
[535] Fix | Delete
*
[536] Fix | Delete
* @since 1.0.2
[537] Fix | Delete
*
[538] Fix | Delete
* @param int $field_id Field ID.
[539] Fix | Delete
* @param string $field_submit Submitted form data.
[540] Fix | Delete
* @param array $form_data Form data and settings.
[541] Fix | Delete
*/
[542] Fix | Delete
public function format( $field_id, $field_submit, $form_data ) {
[543] Fix | Delete
[544] Fix | Delete
$field = $form_data['fields'][ $field_id ];
[545] Fix | Delete
$dynamic = ! empty( $field['dynamic_choices'] ) ? $field['dynamic_choices'] : false;
[546] Fix | Delete
$name = sanitize_text_field( $field['label'] );
[547] Fix | Delete
$value_raw = sanitize_text_field( $field_submit );
[548] Fix | Delete
[549] Fix | Delete
$data = [
[550] Fix | Delete
'name' => $name,
[551] Fix | Delete
'value' => '',
[552] Fix | Delete
'value_raw' => $value_raw,
[553] Fix | Delete
'id' => wpforms_validate_field_id( $field_id ),
[554] Fix | Delete
'type' => $this->type,
[555] Fix | Delete
];
[556] Fix | Delete
[557] Fix | Delete
if ( 'post_type' === $dynamic && ! empty( $field['dynamic_post_type'] ) ) {
[558] Fix | Delete
[559] Fix | Delete
// Dynamic population is enabled using post type.
[560] Fix | Delete
$data['dynamic'] = 'post_type';
[561] Fix | Delete
$data['dynamic_items'] = absint( $value_raw );
[562] Fix | Delete
$data['dynamic_post_type'] = $field['dynamic_post_type'];
[563] Fix | Delete
$post = get_post( $value_raw );
[564] Fix | Delete
[565] Fix | Delete
if ( ! empty( $post ) && ! is_wp_error( $post ) && $data['dynamic_post_type'] === $post->post_type ) {
[566] Fix | Delete
$data['value'] = esc_html( wpforms_get_post_title( $post ) );
[567] Fix | Delete
}
[568] Fix | Delete
} elseif ( 'taxonomy' === $dynamic && ! empty( $field['dynamic_taxonomy'] ) ) {
[569] Fix | Delete
[570] Fix | Delete
// Dynamic population is enabled using taxonomy.
[571] Fix | Delete
$data['dynamic'] = 'taxonomy';
[572] Fix | Delete
$data['dynamic_items'] = absint( $value_raw );
[573] Fix | Delete
$data['dynamic_taxonomy'] = $field['dynamic_taxonomy'];
[574] Fix | Delete
$term = get_term( $value_raw, $data['dynamic_taxonomy'] );
[575] Fix | Delete
[576] Fix | Delete
if ( ! empty( $term ) && ! is_wp_error( $term ) ) {
[577] Fix | Delete
$data['value'] = esc_html( wpforms_get_term_name( $term ) );
[578] Fix | Delete
}
[579] Fix | Delete
} else {
[580] Fix | Delete
[581] Fix | Delete
// Normal processing, dynamic population is off.
[582] Fix | Delete
$choice_key = '';
[583] Fix | Delete
[584] Fix | Delete
// If show_values is true, that means value posted is the raw value
[585] Fix | Delete
// and not the label. So we need to set label value. Also store
[586] Fix | Delete
// the choice key.
[587] Fix | Delete
if ( ! empty( $field['show_values'] ) ) {
[588] Fix | Delete
foreach ( $field['choices'] as $key => $choice ) {
[589] Fix | Delete
if ( ! empty( $field_submit ) && $choice['value'] === $field_submit ) {
[590] Fix | Delete
$data['value'] = sanitize_text_field( $choice['label'] );
[591] Fix | Delete
$choice_key = $key;
[592] Fix | Delete
break;
[593] Fix | Delete
}
[594] Fix | Delete
}
[595] Fix | Delete
} else {
[596] Fix | Delete
[597] Fix | Delete
$data['value'] = $value_raw;
[598] Fix | Delete
[599] Fix | Delete
// Determine choice key, this is needed for image choices.
[600] Fix | Delete
foreach ( $field['choices'] as $key => $choice ) {
[601] Fix | Delete
/* translators: %s - choice number. */
[602] Fix | Delete
if ( $field_submit === $choice['label'] || $value_raw === sprintf( esc_html__( 'Choice %s', 'wpforms-lite' ), $key ) ) {
[603] Fix | Delete
$choice_key = $key;
[604] Fix | Delete
[605] Fix | Delete
break;
[606] Fix | Delete
}
[607] Fix | Delete
}
[608] Fix | Delete
}
[609] Fix | Delete
[610] Fix | Delete
// Images choices are enabled, lookup and store image URL.
[611] Fix | Delete
if ( ! empty( $choice_key ) && ! empty( $field['choices_images'] ) ) {
[612] Fix | Delete
[613] Fix | Delete
$data['image'] = ! empty( $field['choices'][ $choice_key ]['image'] ) ? esc_url_raw( $field['choices'][ $choice_key ]['image'] ) : '';
[614] Fix | Delete
}
[615] Fix | Delete
}
[616] Fix | Delete
[617] Fix | Delete
// Push field details to be saved.
[618] Fix | Delete
wpforms()->get( 'process' )->fields[ $field_id ] = $data;
[619] Fix | Delete
}
[620] Fix | Delete
}
[621] Fix | Delete
[622] Fix | Delete
new WPForms_Field_Radio();
[623] Fix | Delete
[624] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function