Esempio n. 1
0
            $listTaxonomy = array();
            if (!is_wp_error($terms) and !empty($terms)) {
                foreach ($terms as $key => $val) {
                    $listTaxonomy[$val->labels->name] = $key;
                }
            }
            return $listTaxonomy;
        }
        /** from 1.1.7*/
        static function get_taxonomy_and_id_term_tour()
        {
            $list_taxonomy = st_list_taxonomy('st_hotel');
            $list_id_vc = array();
            $param = array();
            foreach ($list_taxonomy as $k => $v) {
                $term = get_terms($v);
                if (!empty($term) and is_array($term)) {
                    foreach ($term as $key => $value) {
                        $list_value[$value->name] = $value->term_id;
                    }
                    $param[] = array("type" => "checkbox", "holder" => "div", "heading" => $k, "param_name" => "id_term_" . $v, "value" => $list_value, 'dependency' => array('element' => 'sort_taxonomy', 'value' => array($v)));
                    $list_value = "";
                    $list_id_vc["id_term_" . $v] = "";
                }
            }
            return array("list_vc" => $param, 'list_id_vc' => $list_id_vc);
        }
    }
    $a = new STHotel();
    $a->init();
}