Esempio n. 1
0
 public static function getUserMeta(...$args)
 {
     if (class_exists(InnThemeUser::class) && method_exists(InnThemeUser::class, 'getUserMeta')) {
         return call_user_func_array([InnThemeUser::class, 'getUserMeta'], $args);
     }
     if (isset($args[3]) && $args[3]) {
         unset($args[3]);
         return Functions::metaToJson(call_user_func_array('\\get_user_meta', $args));
     }
     static $cache = [];
     $cacheID = md5(json_encode($args));
     if (!isset($cache[$cacheID])) {
         $cache[$cacheID] = Functions::metaToJson(call_user_func_array('\\get_user_meta', $args));
     }
     return $cache[$cacheID];
 }
Esempio n. 2
0
 public static function getPostMeta(...$args)
 {
     if (isset($args[3]) && $args[3]) {
         unset($args[3]);
         return Functions::metaToJson(call_user_func_array('\\get_post_meta', $args));
     }
     static $cache = [];
     $cacheID = md5(json_encode($args));
     if (!isset($cache[$cacheID])) {
         $cache[$cacheID] = Functions::metaToJson(call_user_func_array('\\get_post_meta', $args));
     }
     return $cache[$cacheID];
 }