Opened 3 years ago
Closed 3 years ago
#13674 closed defect (bug) (invalid)
custom post type showing add new post instead of custom post type label
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Post Types | Version: | 3.0 |
| Severity: | normal | Keywords: | custom post types |
| Cc: |
Description
I am using wordpress 3.0 and it's multi network system with custom post type setting. I have used following code in themes functions.php
function post_type_movies() {
register_post_type('movies', array(
'label' => __('Movies'),
'public' => true,
'show_ui' => true,
'rewrite' => array("slug" => "movie"),
'supports' => array('title', 'editor', 'custom-fields', 'author', 'thumbnail','comments')
));
register_taxonomy_for_object_type('post_tag', 'movies');
}
add_action('init', 'post_type_movies');
I get the custom post type block but when i add new post in custom post type I see it says Add new post instead of Add new movies.
Change History (3)
comment:1
michaelh
— 3 years ago
- Milestone 3.0 deleted
- Resolution set to worksforme
- Status changed from new to closed
comment:2
follow-up:
↓ 3
kingjeffrey
— 3 years ago
- Resolution worksforme deleted
- Status changed from closed to reopened
- Version changed from 3.0 to 3.0.1
I encountered this same issue, and was able to resolve it by explicitly setting it explicitly as follows:
'labels' => array(
'name' => 'Movies',
'singular_name' => 'Movie',
'add_new_item' => 'Add New Movie',
),
But the 'add_new_item' setting should be automatically determined from 'singular_name' (which it is not).
comment:3
in reply to:
↑ 2
nacin
— 3 years ago
- Resolution set to invalid
- Status changed from reopened to closed
- Version changed from 3.0.1 to 3.0
Replying to kingjeffrey:
But the 'add_new_item' setting should be automatically determined from 'singular_name' (which it is not).
That would not be translatable. #12968
Look at using the labels parameter and the post_updated_messages filter as described in http://codex.wordpress.org/Function_Reference/register_post_type
Closing this as worksforme.