| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | Plugin Name: Test Core Archive Page with Custom Post Type |
|---|
| 4 | Description: This is for Trac ticket #19471. It creates a custom post type called "Product" and adds the Category and Tag taxonomies to it. |
|---|
| 5 | Author: Chris Jean |
|---|
| 6 | */ |
|---|
| 7 | |
|---|
| 8 | add_action( 'init', 'create_post_type' ); |
|---|
| 9 | function create_post_type() { |
|---|
| 10 | register_post_type( 'acme_product', |
|---|
| 11 | array( |
|---|
| 12 | 'labels' => array( |
|---|
| 13 | 'name' => __( 'Products' ), |
|---|
| 14 | 'singular_name' => __( 'Product' ) |
|---|
| 15 | ), |
|---|
| 16 | 'public' => true, |
|---|
| 17 | 'has_archive' => true, |
|---|
| 18 | ) |
|---|
| 19 | ); |
|---|
| 20 | |
|---|
| 21 | register_taxonomy_for_object_type( 'category', 'acme_product' ); |
|---|
| 22 | register_taxonomy_for_object_type( 'post_tag', 'acme_product' ); |
|---|
| 23 | } |
|---|