| | |
| | | */ |
| | | function jvbGetUserByFirstName(string $first_name):WP_User|false |
| | | { |
| | | $cache = CacheManager::for('userFirstname'); |
| | | $cache = CacheManager::for('userFirstname')->connectTo('user'); |
| | | $cached = $cache->get($first_name)??false; |
| | | if ($cached) { |
| | | return get_userdata($cached); |
| | |
| | | */ |
| | | function jvbGetUserByDisplayName(string $display_name):WP_User|false |
| | | { |
| | | $cache = CacheManager::for('user_displaynames'); |
| | | $cache = CacheManager::for('user_displaynames')->connectTo('user'); |
| | | $cached = $cache->get($display_name)??false; |
| | | |
| | | if ($cached && is_int($cached)) { |
| | |
| | | function jvbGetUsername(int $user_id):string |
| | | { |
| | | $key = 'user_display_names'; |
| | | $cache = CacheManager::for('userNames', WEEK_IN_SECONDS); |
| | | $cache = CacheManager::for('userNames', WEEK_IN_SECONDS)->connectTo('user'); |
| | | $cached = $cache->get($user_id); |
| | | |
| | | if ($cached) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | $cache = CacheManager::for('artist', 3600); |
| | | $cache = CacheManager::for('artist', 3600)->connectTo('post'); |
| | | $cached = $cache->get($userID); |
| | | if ($cached) { |
| | | return match ($return) { |