1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Feeds for Custom Post Types Test |
---|
4 | */ |
---|
5 | |
---|
6 | |
---|
7 | add_action('init', 'custom_init'); |
---|
8 | |
---|
9 | function custom_init(){ |
---|
10 | $labels = array( |
---|
11 | 'name' => 'Books', |
---|
12 | 'singular_name' => 'Book', |
---|
13 | 'add_new' => 'Add New', |
---|
14 | 'add_new_item' => 'Add New Book', |
---|
15 | 'edit_item' => 'Edit Book', |
---|
16 | 'new_item' => 'New Book', |
---|
17 | 'all_items' => 'All Books', |
---|
18 | 'view_item' => 'View Book', |
---|
19 | 'search_items' => 'Search Books', |
---|
20 | 'not_found' => 'No books found', |
---|
21 | 'not_found_in_trash' => 'No books found in Trash', |
---|
22 | 'parent_item_colon' => '', |
---|
23 | 'menu_name' => 'Books' |
---|
24 | ); |
---|
25 | |
---|
26 | $args = array( |
---|
27 | 'labels' => $labels, |
---|
28 | 'public' => true, |
---|
29 | 'publicly_queryable' => true, |
---|
30 | 'show_ui' => true, |
---|
31 | 'show_in_menu' => true, |
---|
32 | 'query_var' => true, |
---|
33 | 'rewrite' => array( 'slug' => 'bookhomepage', 'feeds' => false), |
---|
34 | 'capability_type' => 'post', |
---|
35 | 'has_archive' => false, |
---|
36 | 'hierarchical' => false, |
---|
37 | 'menu_position' => null, |
---|
38 | 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ) |
---|
39 | ); |
---|
40 | |
---|
41 | register_post_type( 'book', $args ); |
---|
42 | } |
---|
43 | |
---|
44 | |
---|
45 | add_filter('book_rewrite_rules', create_function('$rules', 'var_dump($rules);return $rules;')); |
---|
46 | |
---|