| @@ 173-189 (lines=17) @@ | ||
| 170 | /** |
|
| 171 | * Clears all IDC specific options. This method is used on disconnect and reconnect. |
|
| 172 | */ |
|
| 173 | static function clear_all_idc_options() { |
|
| 174 | // If the site is currently in IDC, let's also clear the VaultPress connection options. |
|
| 175 | // We have to check if the site is in IDC, otherwise we'd be clearing the VaultPress |
|
| 176 | // connection any time the Jetpack connection is cycled. |
|
| 177 | if ( Jetpack::validate_sync_error_idc_option() ) { |
|
| 178 | delete_option( 'vaultpress' ); |
|
| 179 | delete_option( 'vaultpress_auto_register' ); |
|
| 180 | } |
|
| 181 | ||
| 182 | Jetpack_Options::delete_option( |
|
| 183 | array( |
|
| 184 | 'sync_error_idc', |
|
| 185 | 'safe_mode_confirmed', |
|
| 186 | 'migrate_for_idc', |
|
| 187 | ) |
|
| 188 | ); |
|
| 189 | } |
|
| 190 | ||
| 191 | /** |
|
| 192 | * Does the current admin page have help tabs? |
|
| @@ 248-264 (lines=17) @@ | ||
| 245 | * |
|
| 246 | * @return void |
|
| 247 | */ |
|
| 248 | public static function clear_all_idc_options() { |
|
| 249 | // If the site is currently in IDC, let's also clear the VaultPress connection options. |
|
| 250 | // We have to check if the site is in IDC, otherwise we'd be clearing the VaultPress |
|
| 251 | // connection any time the Jetpack connection is cycled. |
|
| 252 | if ( self::validate_sync_error_idc_option() ) { |
|
| 253 | delete_option( 'vaultpress' ); |
|
| 254 | delete_option( 'vaultpress_auto_register' ); |
|
| 255 | } |
|
| 256 | ||
| 257 | Jetpack_Options::delete_option( |
|
| 258 | array( |
|
| 259 | 'sync_error_idc', |
|
| 260 | 'safe_mode_confirmed', |
|
| 261 | 'migrate_for_idc', |
|
| 262 | ) |
|
| 263 | ); |
|
| 264 | } |
|
| 265 | ||
| 266 | /** |
|
| 267 | * Checks whether the sync_error_idc option is valid or not, and if not, will do cleanup. |
|