| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php /** |
| 2 | 2 | * @version 1.0 |
| 3 | 3 | * @package Booking Calendar |
| 4 | 4 | * @category Support functions for Settings page |
| @@ -81,10 +81,13 @@ | ||
| 81 | 81 | if ( ( isset( $_GET['reset'] ) ) && ( 'custom_forms' == $_GET['reset'] ) ) { // FixIn: 8.1.3.21. |
| 82 | 82 | |
| 83 | 83 | wpbc_open_meta_box_section( 'wpbc_general_settings_system_info', 'System Info' ); |
| 84 | 84 | |
| 85 | - // Reset Custom Booking Forms to NONE | |
| 86 | - update_bk_option( 'booking_forms_extended', serialize( array() ) ); | |
| 85 | + global $wpdb; | |
| 86 | + if ( function_exists( 'wpbc_is_table_exists' ) && wpbc_is_table_exists( 'booking_form_structures' ) ) { | |
| 87 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared | |
| 88 | + $wpdb->query( "DELETE FROM {$wpdb->prefix}booking_form_structures WHERE form_slug <> 'standard'" ); | |
| 89 | + } | |
| 87 | 90 | |
| 88 | 91 | wpbc_show_message_in_settings( '<strong>Custom forms</strong> has been reseted!', 'info' ); |
| 89 | 92 | |
| 90 | 93 | wpbc_close_meta_box_section(); |