Loading issue writing a plugin for extend CF7
-
Hello everyone
I’ve got an issue creating a plugin to extend CF7. When the user submitted the form, I read a field (in example, ‘field-name’). Then, I look for ‘my_number’, a number for a unique ‘field-name’ in a database table. Last of all, I add the new field with the number value to the form and I send it.
The code runs perfectly, I receive all data correctly, but when the user clicks on the button, the spinning arrows are loading forever for the sender. Disable JS is not a valid solution for me and I’m sure that’s my plugin which is making wrong this because when I disable the plugin, CF7 works fine.
Why can my code affect JS for the CF7 plugin? It’s very simple and I don’t use any JavaScript, I’m confused. I’ve wrote a previous version of the plugin and I had not any problem with this.
Can you help me, please?
Thanks (and sorry for my poor English)This is my code, simplified:
<?php /* The tipical WordPress plugin header */ function my_search($cf7) { //Getting the data $my_data = $cf7['field-name']; //Finding the number on database global $wpdb; $my_query = "SELECT my_number FROM wp_my_database WHERE (my_column='$my_data')"; $result = $wpdb->get_results( $my_query ); //Creating a new field for the data foreach ( $result as $row ) $cf7['field-number'] = (string)$row->my_number; return $cf7; } add_filter("wpcf7_posted_data", "my_search"); ?>
The topic ‘Loading issue writing a plugin for extend CF7’ is closed to new replies.