| @@ 68-83 (lines=16) @@ | ||
| 65 | * |
|
| 66 | * @return bool | WP_Error True if option is properly set. |
|
| 67 | */ |
|
| 68 | public static function confirm_safe_mode() { |
|
| 69 | $updated = Jetpack_Options::update_option( 'safe_mode_confirmed', true ); |
|
| 70 | if ( $updated ) { |
|
| 71 | return rest_ensure_response( |
|
| 72 | array( |
|
| 73 | 'code' => 'success', |
|
| 74 | ) |
|
| 75 | ); |
|
| 76 | } |
|
| 77 | ||
| 78 | return new WP_Error( |
|
| 79 | 'error_setting_jetpack_safe_mode', |
|
| 80 | esc_html__( 'Could not confirm safe mode.', 'jetpack' ), |
|
| 81 | array( 'status' => 500 ) |
|
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * Handles identity crisis mitigation, migrating stats and subscribers from old url to this, new url. |
|
| @@ 2130-2144 (lines=15) @@ | ||
| 2127 | * |
|
| 2128 | * @return bool | WP_Error True if option is properly set. |
|
| 2129 | */ |
|
| 2130 | public static function confirm_safe_mode() { |
|
| 2131 | $updated = Jetpack_Options::update_option( 'safe_mode_confirmed', true ); |
|
| 2132 | if ( $updated ) { |
|
| 2133 | return rest_ensure_response( |
|
| 2134 | array( |
|
| 2135 | 'code' => 'success', |
|
| 2136 | ) |
|
| 2137 | ); |
|
| 2138 | } |
|
| 2139 | return new WP_Error( |
|
| 2140 | 'error_setting_jetpack_safe_mode', |
|
| 2141 | esc_html__( 'Could not confirm safe mode.', 'jetpack' ), |
|
| 2142 | array( 'status' => 500 ) |
|
| 2143 | ); |
|
| 2144 | } |
|
| 2145 | ||
| 2146 | /** |
|
| 2147 | * Handles identity crisis mitigation, migrating stats and subscribers from old url to this, new url. |
|