/** * registering the custom taxonomy and the table for category meta */ function register_taxonomies() { global $wpdb; $places_cats_args = array('hierarchical' => true, 'query_var' => 'places-category', 'labels' => array('name' => __('Places Categories', 'bp-checkins'), 'singular_name' => __('Places Category', 'bp-checkins'), 'edit_item' => __('Edit Places Category', 'bp-checkins'), 'update_item' => __('Update Places Category', 'bp-checkins'), 'add_new_item' => __('Add New Places Category', 'bp-checkins'), 'new_item_name' => __('New Places Category Name', 'bp-checkins'), 'all_items' => __('All Places Categories', 'bp-checkins'), 'search_items' => __('Search Places Categories', 'bp-checkins'), 'parent_item' => __('Parent Places Category', 'bp-checkins'), 'parent_item_colon' => __('Parent Places Category:', 'bp-checkins'))); //register the Category taxo register_taxonomy('places_category', array('places'), $places_cats_args); $wpdb->places_categorymeta = $wpdb->prefix . "places_categorymeta"; //Let's insert a default category if none is set ! $bp_checkins_check_taxo = get_terms('places_category'); if (empty($bp_checkins_check_taxo)) { wp_insert_term(__('Default', 'bp-checkins'), 'places_category', array('slug' => 'default')); } parent::register_taxonomies(); }