PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | paypal/controllers/FrmPayPalLiteSettingsController.php +24 -0 6.31 → trunk View file →
@@ -54,5 +54,29 @@
54 54 // phpcs:ignore WordPress.Security.NonceVerification.Missing
55 55 $settings->update( $_POST );
56 56 $settings->store();
57 57 }
58 +
59 + /**
60 + * Preserve test_mode when the PayPal add-on updates frm_paypal_options.
61 + * This hooks into update_option to ensure test_mode isn't lost.
62 + *
63 + * @param mixed $old_value The old option value.
64 + * @param mixed $new_value The new option value.
65 + *
66 + * @return void
67 + */
68 + public static function preserve_test_mode_on_update( $old_value, $new_value ) {
69 + if ( ! is_object( $old_value ) || ! is_object( $new_value ) ) {
70 + return;
71 + }
72 +
73 + // If old value had test_mode but new value doesn't, preserve it
74 + if ( ! isset( $old_value->test_mode ) || isset( $new_value->test_mode ) ) {
75 + return;
76 + }
77 +
78 + $new_value->test_mode = $old_value->test_mode;
79 + // Update the option with the preserved test_mode
80 + update_option( 'frm_paypal_options', $new_value );
81 + }
58 82 }