Pierre RASO
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [Simple Fields] [Plugin: Simple Fields] Value of Radio Buttons@shua somthing is missing in your code (and mine for radio buttons) : when editing again, selected velue does not appear as selected. Default value appears as selected instead
So, I had to change in functions_post.php, line 433
if ($use_defaults == false && $saved_value == $one_option_internal_name) {
to
if ($use_defaults == false && $saved_value == $dropdown_value_esc) {
and change line 414 :
if ($saved_value == $one_radio_option_key) { $selected = " checked='checked' "; }
to
if ($saved_value == esc_html($one_radio_option_val["value"])) { $selected = " checked='checked' "; }
Forum: Plugins
In reply to: [Simple Fields] [Plugin: Simple Fields] Value of Radio ButtonsGreat tip but :
- you could do the same for radio buttons
change in functions_post.php, line 418:
echo "<input $selected name='$field_name' id='$radio_field_unique_id' type='radio' value='$one_radio_option_key' />";
to :
echo "<input $selected name='$field_name' id='$radio_field_unique_id' type='radio' value='".esc_html($one_radio_option_val["value"])."' />";
- I think you will have problems with simple fields front-end functions (simple_fields_get_post_value and simple_fields_get_post_group_values) which use special processing to retrieve stored values for dropdown and radio buttons.
for this change in functions_post.php, lines 792 and 862 (simple fields 0.3.9) or lines 779 and 849 (simple fields 0.3.8) :
$saved_values[$saved_i] = $one_field[$get_value_key][$saved_values[$saved_i]]["value"];
to
if ($one_field[$get_value_key][$saved_values[$saved_i]]["value"]) {$saved_values[$saved_i] = $one_field[$get_value_key][$saved_values[$saved_i]]["value"];}
This works fine for me with 0.3.8
- you could do the same for radio buttons
Viewing 2 replies - 1 through 2 (of 2 total)