created plugin custer, and removed shortcodes change_id and user_infos from cipf plugin

This commit is contained in:
asus
2024-03-17 02:27:28 +01:00
parent 494943e4f7
commit 6ad1fb5137
13 changed files with 668 additions and 127 deletions

View File

@@ -0,0 +1,48 @@
<?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)
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;
self::$_backup_current_user = null;
return $backup_user;
}
}
?>