57 lines
1.2 KiB
PHP
57 lines
1.2 KiB
PHP
<?php
|
|
namespace CUSTER;
|
|
|
|
/*
|
|
* it means someone outside wp is accessing the file, in this case kill it.
|
|
*/
|
|
if (!defined('ABSPATH')) {
|
|
die('You can not access this file!');
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
*
|
|
*/
|
|
class Custer {
|
|
|
|
const USER_INFO_DATE_FORMAT = 'd/m/Y'; // for user_infos.php (date format : https://www.php.net/manual/fr/datetime.format.php)
|
|
const SLUG_TOOGLE_ADMIN_MENU = ['_name'=>'toogle_admin_menu_url_custer', 'toggle'=>'toggle', 'show'=>'show', 'hide'=>'hide'];
|
|
const OPTION_TOGGLE_MENU = ['_name'=>'toggle_admin_menu_option_custer', 'show'=>'show', 'hide'=>'hide'];
|
|
const OPTION_ANCHOR = 'custer_anchor_ids';
|
|
|
|
private static $_backup_current_user = null;
|
|
|
|
|
|
/*
|
|
* setter and getter for current user backup
|
|
*
|
|
*/
|
|
public static function set_current_user_backup() {
|
|
if (self::$_backup_current_user !== null)
|
|
return;
|
|
self::$_backup_current_user = get_current_user_id();
|
|
}
|
|
public static function get_current_user_backup() {
|
|
return self::$_backup_current_user;
|
|
}
|
|
public static function reset_current_user_backup() {
|
|
$backup_user = self::$_backup_current_user;
|
|
if ($backup_user === null) {
|
|
$backup_user = get_current_user_id();
|
|
}
|
|
self::$_backup_current_user = null;
|
|
return $backup_user;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|