Skip to content

Commit b9bfe0e

Browse files
committed
Add ability to toggle Site Kit dashboard feature.
1 parent 61085ca commit b9bfe0e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/wordpress-plugins/yoast-seo.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public function get_features() {
8484
'reset_premium_workouts' => \esc_html__( 'Premium workouts progress', 'yoast-test-helper' ),
8585
'reset_options' => \esc_html__( 'Options', 'yoast-test-helper' ),
8686
'reset_cornerstone_flags' => \esc_html__( 'Cornerstone flags', 'yoast-test-helper' ),
87+
'toggle_site_kit_feature' => \esc_html__( 'Toggle Site Kit feature flag', 'yoast-test-helper' ),
8788
];
8889
}
8990

@@ -132,6 +133,9 @@ public function reset_feature( $feature ) {
132133
case 'reset_cornerstone_flags':
133134
$this->reset_cornerstone_flags();
134135
return true;
136+
case 'toggle_site_kit_feature':
137+
$this->toggle_site_kit_feature();
138+
return true;
135139
}
136140

137141
return false;
@@ -162,6 +166,15 @@ private function reset_internal_link_count() {
162166
$this->reset_indexing_notification( 'indexables-reset-by-test-helper' );
163167
}
164168

169+
/**
170+
* Toggles the Site Kit feature flag.
171+
*
172+
* @return void
173+
*/
174+
private function toggle_site_kit_feature() {
175+
WPSEO_Options::set( 'google_site_kit_feature_enabled', ! WPSEO_Options::get( 'google_site_kit_feature_enabled' ) );
176+
}
177+
165178
/**
166179
* Resets the prominent words calculation.
167180
*

0 commit comments

Comments
 (0)