31 lines
492 B
PHP
31 lines
492 B
PHP
<?php
|
|
/**
|
|
* @package ogre-suspension
|
|
* @author cleverogre
|
|
* @version 1.0.0
|
|
* @since 1.0.0
|
|
*/
|
|
|
|
namespace Ogre\Suspension;
|
|
|
|
use Ogre\Singleton;
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
final class Admin {
|
|
use Singleton;
|
|
|
|
protected function __construct() {
|
|
add_action('admin_init', [$this, 'maybe_logout'], 1);
|
|
}
|
|
|
|
public function maybe_logout():void {
|
|
if (!is_user_logged_in()) return;
|
|
wp_logout();
|
|
Redirect::do_redirect();
|
|
}
|
|
|
|
}
|
|
|
|
Admin::instance();
|