Code Duplication    Length = 20-20 lines in 2 locations

geodirectory-functions/cat-meta-functions/Tax-meta-class.php 2 locations

@@ 2015-2034 (lines=20) @@
2012
2013
2014
        //get term meta field
2015
        public function get_tax_meta($term_id, $key, $multi = false, $post_type = '')
2016
        {
2017
2018
            if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2019
                $taxObject = get_taxonomy($_REQUEST['taxonomy']);
2020
                $post_type = $taxObject->object_type[0];
2021
            }
2022
2023
            if($post_type=='post'){$post_type='';}
2024
            if($post_type){$post_type = $post_type.'_';}
2025
2026
            $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id;
2027
2028
            $m = get_option('tax_meta_' . $post_type  . $t_id);
2029
            if (isset($m[$key])) {
2030
                return $m[$key];
2031
            } else {
2032
                return '';
2033
            }
2034
        }
2035
2036
        //delete meta
2037
        public function delete_tax_meta($term_id, $key, $post_type = '')
@@ 2098-2117 (lines=20) @@
2095
2096
//get term meta field
2097
if (!function_exists('get_tax_meta')) {
2098
    function get_tax_meta($term_id, $key, $multi = false, $post_type = '')
2099
    {
2100
2101
        if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2102
            $taxObject = get_taxonomy($_REQUEST['taxonomy']);
2103
            $post_type = $taxObject->object_type[0];
2104
        }
2105
2106
        if($post_type=='post'){$post_type='';}
2107
        if($post_type){$post_type = $post_type.'_';}
2108
2109
        $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id;
2110
2111
        $m = get_option('tax_meta_' . $post_type  . $t_id);
2112
        if (isset($m[$key])) {
2113
            return $m[$key];
2114
        } else {
2115
            return '';
2116
        }
2117
    }
2118
}
2119
2120
//delete meta