on_name = $this->get_option_name(); if ( ! $option_name ) { return false; } $paused_extensions = (array) get_option( $option_name, array() ); unset( $paused_extensions[ $this->type ] ); if ( ! $paused_extensions ) { return delete_option( $option_name ); } return update_option( $option_name, $paused_extensions ); } /** * Checks whether the underlying API to store paused extensions is loaded. * * @since 5.2.0 * * @return bool True if the API is loaded, false otherwise. */ protected function is_api_loaded() { return function_exists( 'get_option' ); } /** * Get the option name for storing paused extensions. * * @since 5.2.0 * * @return string */ protected function get_option_name() { if ( ! wp_recovery_mode()->is_active() ) { return ''; } $session_id = wp_recovery_mode()->get_session_id(); if ( empty( $session_id ) ) { return ''; } return "{$session_id}_paused_extensions"; } }