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