Custom post type and comment management
-
Hi,
I’m currently playing with “custom post type” in WordPress 3.0. I have created the following custom type in my functions.php:register_post_type(‘album’, array(
‘label’ => __(‘Albums’),
‘singular_label’ => __(‘Album’),
‘public’ => true,
‘show_ui’ => true,
‘publicly_queryable’ => true,
‘exclude_from_search’ => false,
‘capability_type’ => ‘page’,
‘hierarchical’ => false,
‘rewrite’ => false,
‘query_var’ => true,
‘supports’ => array(‘title’, ‘editor’, ‘custom-fields’),
‘rewrite’ => array(‘slug’ => ‘album’, ‘with_front’ => false )
));I have then created programmatically some new page following this custom type:
$post = array();
$post[‘post_type’] = ‘album’;
$post[‘post_content’] = ‘lorem ipsum’;
$post[‘post_parent’] = 0;
$post[‘post_author’] = 1;
$post[‘post_status’] = ‘publish’;
$post[‘post_title’] = ‘lorem ipsum’;
$postid = wp_insert_post ($post);Everything is working fine : I’m able to see the created articles in the WordPress admin and on my site. On the site, comments are allowed, I can add comments and they are correctly registered.
However, when I edit the page and click on the “Update” button, changes are saved but comments are now closed… I don’t understand this behavior. Moreover, I’m not able to allow comments again as I don’t have the comment panel on the WordPress admin for this custom type.
Could someone figure what is happening?
Thanks,
Nicolas
- The topic ‘Custom post type and comment management’ is closed to new replies.