osc_category()

osc_category()

Gets current category

Code osc_category():

    function osc_category() {
        if (View::newInstance()->_exists('subcategories')) {
            $category = View::newInstance()->_current('subcategories');
        } elseif (View::newInstance()->_exists('categories')) {
            $category = View::newInstance()->_current('categories');
        } elseif (View::newInstance()->_exists('category')) {
            $category = View::newInstance()->_get('category');
        } else {
            $category = null;
        }
        return($category);
    }

    /**
     * @return array
     */