1 | function CPTtest(){ |
---|
2 | $post_type_tag = 'DomainName'; |
---|
3 | |
---|
4 | $l10n_tag = 'cpt_test'; |
---|
5 | |
---|
6 | register_taxonomy('domfolder', $post_type_tag, |
---|
7 | array( |
---|
8 | 'hierarchical' => true, |
---|
9 | 'label' => __('Folder', $l10n_tag), |
---|
10 | 'public'=>true, 'show_ui'=>true, |
---|
11 | 'query_var' => false, |
---|
12 | 'rewrite' => true/*array('slug'=>'dom_folder', 'with_front'=>false, 'hierarchical'=>true)*/ |
---|
13 | ) |
---|
14 | ); |
---|
15 | |
---|
16 | register_taxonomy('domtags', $post_type_tag, |
---|
17 | array( |
---|
18 | 'hierarchical' => false, |
---|
19 | 'label' => __('Domain Tags', $l10n_tag), |
---|
20 | 'public'=>true,'show_ui'=>true, |
---|
21 | 'query_var' => false, |
---|
22 | 'rewrite' => true /*array('slug'=>'dom_tags', 'with_front'=>false)*/ |
---|
23 | ) |
---|
24 | ); |
---|
25 | |
---|
26 | register_post_type( $post_type_tag ,array( |
---|
27 | 'label' => __('Domain Name', $l10n_tag ), |
---|
28 | 'labels' => array( |
---|
29 | 'name' => 'Domain Name', |
---|
30 | 'singular_name' => __('Domain Name', $l10n_tag), |
---|
31 | 'add_new' => __('New Domain Name', $l10n_tag ), |
---|
32 | 'add_new_item' => __('Add New Domain Name', $l10n_tag ), |
---|
33 | 'edit' => __( 'Edit Domain Name' , $l10n_tag ), |
---|
34 | 'edit_item' => __( 'Edit Domain Name' , $l10n_tag ), |
---|
35 | 'new_item' => __( 'New Domain Name' , $l10n_tag ), |
---|
36 | 'view' => __( 'View Domain Name' , $l10n_tag ), |
---|
37 | 'view_item' => __( 'View Domain Name' , $l10n_tag ), |
---|
38 | 'search_items' => __( 'Search Domain Names' , $l10n_tag ), |
---|
39 | 'not_found' => __( 'No domains found' , $l10n_tag ), |
---|
40 | 'not_found_in_trash' => __( 'No Domains found in Trash' , $l10n_tag ) |
---|
41 | ), |
---|
42 | 'public' => true, |
---|
43 | 'show_ui' => true, |
---|
44 | 'capability_type' => 'post', |
---|
45 | 'hierarchical' => false, |
---|
46 | 'supports' => array('title', 'editor', 'excerpt', 'comments'), |
---|
47 | 'taxonomies' => array('domfolder','domtags'), |
---|
48 | /* 'register_meta_box_cb ' => 'addMeta' */ |
---|
49 | 'can_export' => true, |
---|
50 | 'rewrite' => |
---|
51 | array('slug'=>'domain-name','with_front'=>false, |
---|
52 | 'archive'=>'domain_names' // #13818 |
---|
53 | ), |
---|
54 | 'query_var' => true, |
---|
55 | 'publicly_queryable' => true, |
---|
56 | 'permalink_epmask'=>EP_PERMALINK, |
---|
57 | 'show_in_nav_menus' => false, |
---|
58 | 'has_archive' => 'domain_names' |
---|
59 | ) |
---|
60 | ); |
---|
61 | |
---|
62 | /*error_log("env: ".print_r($GLOBALS['wp_taxonomies'],r)); |
---|
63 | $t=\get_object_taxonomies('DomainName'); |
---|
64 | error_log("setup: ".serialize($t));*/ |
---|
65 | } |
---|