WPLib::cache_get PHP Method

cache_get() static public method

static public cache_get ( string $key, string $group = '' ) : mixed
$key string
$group string
return mixed
    static function cache_get($key, $group = '')
    {
        if (!is_string($key) && !is_int($key) && static::is_development()) {
            static::trigger_error(__('Cache key is not string or numeric.', 'wplib'));
        }
        $cache = !defined('WPLIB_BYPASS_CACHE') ? wp_cache_get($key, static::_filter_group($group)) : null;
        return $cache;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  *
  */
 static function _wp_loaded()
 {
     if (!WPLib::cache_get($cache_key = 'roles_initialized')) {
         self::_initialize_roles();
         WPLib::cache_set($cache_key, true);
     }
 }
All Usage Examples Of WPLib::cache_get