| @@ -53,9 +53,16 @@ | ||
| 53 | 53 | array( 'jquery' ), |
| 54 | 54 | WP_BK_VERSION_NUM, |
| 55 | 55 | array( 'in_footer' => WPBC_JS_IN_FOOTER ) |
| 56 | 56 | ); |
| 57 | - wp_localize_script( 'wpbc-admin-deactivation-feedback', 'wpbc_plugins_params', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); | |
| 57 | + wp_localize_script( | |
| 58 | + 'wpbc-admin-deactivation-feedback', | |
| 59 | + 'wpbc_plugins_params', | |
| 60 | + array( | |
| 61 | + 'ajax_url' => admin_url( 'admin-ajax.php' ), | |
| 62 | + 'more_details_required_text' => esc_html__( 'Please share more details before submitting.', 'booking' ), | |
| 63 | + ) | |
| 64 | + ); | |
| 58 | 65 | |
| 59 | 66 | wp_enqueue_style( 'wpbc-admin-deactivation-feedback', trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/feedback.css', array(), WP_BK_VERSION_NUM ); |
| 60 | 67 | } |
| 61 | 68 | |
| @@ -114,8 +121,16 @@ | ||
| 114 | 121 | } |
| 115 | 122 | |
| 116 | 123 | if ( ! empty( $_POST[ "wpbc_deactivate-feedback-more-details" ] ) ) { |
| 117 | 124 | $reason_text = sanitize_textarea_field( wp_unslash( $_POST[ "wpbc_deactivate-feedback-more-details" ] ) ); |
| 125 | + } | |
| 126 | + | |
| 127 | + if ( ( '' !== $reason_slug ) && ( '' === trim( $reason_text ) || '---' === $reason_text ) ) { | |
| 128 | + wp_send_json_error( | |
| 129 | + array( | |
| 130 | + 'message' => esc_html__( 'Please share more details before submitting.', 'booking' ), | |
| 131 | + ) | |
| 132 | + ); | |
| 118 | 133 | } |
| 119 | 134 | |
| 120 | 135 | $deactivation_data = array( |
| 121 | 136 | 'reason_text' => $reason_text, |