/** * Get the current portfolio categories * * @return array list of category slugs */ public static function get_categories() { global $post; if (!isset(self::$cats)) { self::$cats = is_page() ? unserialize(get_post_meta($post->ID, 'fancy-portfolio-categories', true)) : array(); } return self::$cats; }