Reply To: Send label select menu Notification

Home Forums Quform WordPress Send label select menu Notification Reply To: Send label select menu Notification

#35417
marianogi
Participant

Hi, Ally. I don’t know why your code does not work for me, I never get the label value.

I get the value with:


add_filter('quform_post_process_1', function (array $result, Quform_Form $form) {
$data = array(
'provincia' => $form->getValue('quform_1_17')
);
}, 10, 3);

And also this:

function add_option_label_to_value($value, Quform_Element_Multi $element, Quform_Form $form) {
if ($form->config('environment') == 'frontend') {
foreach ($element->getOptions() as $option) {
if ($option['value'] == $value) {
$value = esc_html($option['label']) . ' (' . $value . ')';
}
}
}
return $value;
}
add_filter('quform_get_value_html_1_17', 'add_option_label_to_value', 10, 3);

So why I don’t get this value: esc_html($option[‘label’]) . ‘ (‘ . $value . ‘)’ when I read the value: $data[‘provincia’] ?

I read the the value as if the ‘quform_get_value_html’ code wouldn’t exists.

I don’t know what I am doing wrong. Thank you for your help

Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy