function hocwp_register_taxonomy_product_tag() { $slug = apply_filters('hocwp_taxonomy_product_tag_slug', 'product-tag'); $args = array('name' => __('Product Tags', 'hocwp-theme'), 'singular_name' => __('Product Tag', 'hocwp-theme'), 'menu_name' => __('Tags', 'hocwp-theme'), 'taxonomy' => 'product_tag', 'slug' => $slug, 'post_types' => 'product'); hocwp_register_taxonomy($args); }
function hocwp_register_taxonomy_private($args = array()) { $args['exclude_from_search'] = true; $args['show_in_quick_edit'] = false; $args['show_in_nav_menus'] = false; $args['show_admin_column'] = false; $args['show_in_admin_bar'] = false; $args['menu_position'] = 9999999; $args['show_tagcloud'] = false; $args['has_archive'] = false; $args['query_var'] = false; $args['rewrite'] = false; $args['public'] = false; $args['feeds'] = false; hocwp_register_taxonomy($args); }
function hocwp_classifieds_post_type_and_taxonomy() { $name = __('Types', 'hocwp-theme'); $singular = __('Type', 'hocwp-theme'); $slug = apply_filters('hocwp_taxonomy_classifieds_type_slug', hocwp_taxonomy_classifieds_type_base()); $args = array('name' => $name, 'singular_name' => $singular, 'slug' => $slug, 'taxonomy' => 'classifieds_type', 'post_types' => array('post')); hocwp_register_taxonomy($args); $custom_taxonomy = apply_filters('hocwp_classifieds_custom_taxonomy', false); if ($custom_taxonomy) { hocwp_register_taxonomy_administrative_boundaries(); } else { } $name = __('Prices', 'hocwp-theme'); $singular = __('Price', 'hocwp-theme'); $args = array('name' => $name, 'singular_name' => $singular, 'slug' => hocwp_taxonomy_price_base(), 'taxonomy' => 'price', 'show_admin_column' => false, 'post_types' => array('post')); hocwp_register_taxonomy($args); $name = __('Acreages', 'hocwp-theme'); $singular = __('Acreage', 'hocwp-theme'); $args = array('name' => $name, 'singular_name' => $singular, 'slug' => hocwp_taxonomy_acreage_base(), 'taxonomy' => 'acreage', 'show_admin_column' => false, 'post_types' => array('post')); hocwp_register_taxonomy($args); $use = apply_filters('hocwp_use_taxonomy_classifieds_object', false); if ($use) { $name = __('Objects', 'hocwp-theme'); $singular = __('Object', 'hocwp-theme'); $args = array('name' => $name, 'singular_name' => $singular, 'slug' => hocwp_taxonomy_classifieds_object_base(), 'taxonomy' => 'classifieds_object', 'show_admin_column' => false, 'post_types' => array('post')); hocwp_register_taxonomy($args); } $use = apply_filters('hocwp_use_taxonomy_salary', false); if ($use) { $name = __('Salaries', 'hocwp-theme'); $singular = __('Salary', 'hocwp-theme'); $args = array('name' => $name, 'singular_name' => $singular, 'slug' => hocwp_taxonomy_salary_base(), 'taxonomy' => 'salary', 'show_admin_column' => false, 'post_types' => array('post')); hocwp_register_taxonomy($args); } $name = __('Units', 'hocwp-theme'); $singular = __('Unit', 'hocwp-theme'); $args = array('name' => $name, 'singular_name' => $singular, 'slug' => 'currency_unit', 'taxonomy' => 'currency_unit', 'show_admin_column' => false, 'post_types' => array('post')); hocwp_register_taxonomy_private($args); hocwp_register_post_type_news(); }
function hocwp_register_post_type_news($args = array()) { $lang = hocwp_get_language(); $slug = 'news'; if ('vi' == $lang) { $slug = 'tin-tuc'; } $slug = apply_filters('hocwp_post_type_news_base_slug', $slug); $slug = apply_filters('hocwp_post_type_news_slug', $slug); $defaults = array('name' => __('News', 'hocwp-theme'), 'slug' => $slug, 'post_type' => 'news', 'show_in_admin_bar' => true, 'supports' => array('editor', 'thumbnail', 'comments')); $args = wp_parse_args($args, $defaults); hocwp_register_post_type($args); $slug = 'news-cat'; if ('vi' == $lang) { $slug = 'chuyen-muc'; } $slug = apply_filters('hocwp_taxonomy_news_category_base_slug', $slug); $args = array('name' => __('News Categories', 'hocwp-theme'), 'singular_name' => __('News Category', 'hocwp-theme'), 'post_types' => 'news', 'menu_name' => __('Categories', 'hocwp-theme'), 'slug' => $slug, 'taxonomy' => 'news_cat'); hocwp_register_taxonomy($args); $news_tag = apply_filters('hocwp_post_type_news_tag', false); if ($news_tag) { $slug = 'news-tag'; if ('vi' == $lang) { $slug = 'the'; } $slug = apply_filters('hocwp_taxonomy_news_tag_base_slug', $slug); $args = array('name' => __('News Tags', 'hocwp-theme'), 'singular_name' => __('News Tag', 'hocwp-theme'), 'post_types' => 'news', 'menu_name' => __('Tags', 'hocwp-theme'), 'slug' => $slug, 'hierarchical' => false, 'taxonomy' => 'news_tag'); hocwp_register_taxonomy($args); } }