File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ public function __construct() {
50
50
51
51
add_action ( 'admin_init ' , array ( $ this , 'aiosrs_maybe_migrate_analytics_tracking ' ) );
52
52
53
+ add_action ( 'admin_init ' , array ( $ this , 'aiosrs_remove_general_usage_tracking_field ' ), 15 );
54
+
53
55
add_filter ( 'plugins_loaded ' , array ( $ this , 'rich_snippet_translation ' ) );
54
56
add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'post_enqueue ' ) );
55
57
add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'post_new_enqueue ' ) );
@@ -403,6 +405,24 @@ public function aiosrs_maybe_migrate_analytics_tracking() {
403
405
}
404
406
}
405
407
}
408
+
409
+ /**
410
+ * Remove usage tracking checkbox from WordPress General settings.
411
+ *
412
+ * @since 1.7.2
413
+ * @return void
414
+ */
415
+ public function aiosrs_remove_general_usage_tracking_field () {
416
+ global $ wp_settings_fields ;
417
+
418
+ $ field_id = 'aiosrs-analytics-optin ' ;
419
+
420
+ if ( isset ( $ wp_settings_fields ['general ' ]['default ' ][ $ field_id ] ) ) {
421
+ unset( $ wp_settings_fields ['general ' ]['default ' ][ $ field_id ] );
422
+ }
423
+
424
+ unregister_setting ( 'general ' , 'aiosrs_analytics_optin ' );
425
+ }
406
426
}
407
427
}
408
428
require_once plugin_dir_path ( __FILE__ ) . 'functions.php ' ;
You can’t perform that action at this time.
0 commit comments