WP_Recovery_Mode::initialize() WordPress Method
The initialize() method is used to set up the recovery mode for a Wordpress site. This mode is used when there is an issue with the site that needs to be fixed. The site will be taken offline and a message will be displayed to the users.
WP_Recovery_Mode::initialize() #
Initialize recovery mode for the current request.
Source
File: wp-includes/class-wp-recovery-mode.php
public function initialize() {
$this->is_initialized = true;
add_action( 'wp_logout', array( $this, 'exit_recovery_mode' ) );
add_action( 'login_form_' . self::EXIT_ACTION, array( $this, 'handle_exit_recovery_mode' ) );
add_action( 'recovery_mode_clean_expired_keys', array( $this, 'clean_expired_keys' ) );
if ( ! wp_next_scheduled( 'recovery_mode_clean_expired_keys' ) && ! wp_installing() ) {
wp_schedule_event( time(), 'daily', 'recovery_mode_clean_expired_keys' );
}
if ( defined( 'WP_RECOVERY_MODE_SESSION_ID' ) ) {
$this->is_active = true;
$this->session_id = WP_RECOVERY_MODE_SESSION_ID;
return;
}
if ( $this->cookie_service->is_cookie_set() ) {
$this->handle_cookie();
return;
}
$this->link_service->handle_begin_link( $this->get_link_ttl() );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |