@@ -480,33 +480,33 @@ public function maybe_track_analytics() {
480
480
}
481
481
}
482
482
483
- /**
484
- * Save analytics option to network.
485
- *
486
- * @param string $option Name of option.
487
- * @param string $value Value of option.
488
- * @since 1.0.0
489
- */
490
- public function add_option_to_network ( $ option , $ value ) {
491
-
492
- // Verify nonce to prevent CSRF attacks.
493
- if ( ! isset ( $ _POST ['_wpnonce ' ] ) || ! wp_verify_nonce ( sanitize_text_field ( wp_unslash ( $ _POST ['_wpnonce ' ] ) ), 'general-options ' ) ) {
494
- return ; // Stop execution if nonce is invalid.
495
- }
496
-
497
- // If action is coming from the general settings page.
498
- if ( isset ( $ _POST ['option_page ' ] ) && 'general ' === sanitize_text_field ( wp_unslash ( $ _POST ['option_page ' ] ) ) ) {
499
-
500
- $ option = sanitize_key ( $ option ); // Sanitize option name.
501
- $ value = sanitize_text_field ( $ value ); // Sanitize option value (use a different function if storing more complex data).
502
-
503
- if ( get_site_option ( $ option ) ) {
504
- update_site_option ( $ option , $ value );
505
- } else {
506
- add_site_option ( $ option , $ value );
507
- }
508
- }
509
- }
483
+ /**
484
+ * Save analytics option to network.
485
+ *
486
+ * @param string $option Name of option.
487
+ * @param string $value Value of option.
488
+ * @since 1.0.0
489
+ */
490
+ public function add_option_to_network ( $ option , $ value ) {
491
+
492
+ // Verify nonce to prevent CSRF attacks.
493
+ if ( ! isset ( $ _POST ['_wpnonce ' ] ) || ! wp_verify_nonce ( sanitize_text_field ( wp_unslash ( $ _POST ['_wpnonce ' ] ) ), 'general-options ' ) ) {
494
+ return ; // Stop execution if nonce is invalid.
495
+ }
496
+
497
+ // If action is coming from the general settings page.
498
+ if ( isset ( $ _POST ['option_page ' ] ) && 'general ' === sanitize_text_field ( wp_unslash ( $ _POST ['option_page ' ] ) ) ) {
499
+
500
+ $ option = sanitize_key ( $ option ); // Sanitize option name.
501
+ $ value = sanitize_text_field ( $ value ); // Sanitize option value (use a different function if storing more complex data).
502
+
503
+ if ( get_site_option ( $ option ) ) {
504
+ update_site_option ( $ option , $ value );
505
+ } else {
506
+ add_site_option ( $ option , $ value );
507
+ }
508
+ }
509
+ }
510
510
511
511
}
512
512
}
0 commit comments