Hi Jyoti, Thanks for your feedback. I forgot to mention that I also modified the class-create-conditional-fields.php file to include the data-logic attribute manually.
Specifically, I replaced the original template output with the following code:
$condition = count( $logic_object ) > 0 ? wp_json_encode( $logic_object ) : '';if ( ! empty( $condition ) ) {
if ( is_object( $widget ) && method_exists( $widget, 'get_id' ) ) {
$form_id = $widget->get_id();
}
$template_id = 'cfef_logic_data_' . $form_id;
$encoded_json = base64_encode( wp_json_encode( $logic_object ) );
echo '<template id="' . esc_attr( $template_id ) . '" class="cfef_logic_data_js" data-form-id="' . esc_attr( $form_id ) . '" data-logic="' . esc_attr( $encoded_json ) . '"></template>';
}


Leave a Reply