/** * finds parent of given category * @access public static * @param int category_id ID of category * parent_id or false if root level category */ static function find_parent($category_id) { $position = Category::get_position($category_id); $position_slices = explode(">", $position); $key = count($position_slices) - 3; $parent = @$position_slices[$key]; if ($parent == '') { return false; } else { return $parent; } }