I have a feeling this is a bug.
When you create a new custom post type it does not seem possible to modify the first submenu item text. I am referring to the link which allows you to view the post list.
For what I can tell it just seems to be duplicating the name name of the main post type menu which was created.
Does anyone know how to modify this text so that I can have the main menu element says "Articles" and the post list submenu name to say "Manage Articles"?
I was under the impression that "edit_item"
would control the text to be displayed in te submenu but for some reason this is not registering.
Here is the code I am currently using:
//////////////////////////////////////////////////////////////////////////////
// CUSTOM POSTTYPE FOR -- ARTICLES
//////////////////////////////////////////////////////////////////////////////
add_action('init', 'articles');
function articles() {
register_post_type('articles', array(
'labels' => array(
'name' => __('Articles'),
'singular_label' => __('Article'),
'new_item' => __('Add Article'),
'add_new' => __('Add Article'),
'add_new_item' => __('Add Article'),
'edit' => __('Edit Article'),
'edit_item' => __('Edit Article'),
'view' => __('View Article'),
'view_item' => __('View Article'),
'search_items' => __('Search Articles'),
'not_found' => __('No Articles Found'),
'not_found_in_trash' => __('No Articles Found in Trash'),
),
'supports' => array(
'thumbnail',
'title',
'editor',
'author',
'revisions',
),
'rewrite' => array(
'slug' => 'articles',
'with_front' => false,
),
'rewrite' => true,
'can_export' => true,
'show_ui' => true,
'menu_position' => 3,
'public' => true,
'query_var' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'capability_type' => 'post',
'hierarchical' => false,
));
}
add_filter('manage_edit-articles_columns', 'add_new_articles_columns');
function add_new_articles_columns($articles_columns) {
$new_columns['cb'] = '<input type="checkbox" />';
$new_columns['article_thumbnail'] = _x('Image', 'column name');
$new_columns['title'] = _x('Article Title', 'column name');
$new_columns['article_excerpt'] = _x('Article Excerpt', 'column name');
$new_columns['article_source'] = _x('Article Source', 'column name');
$new_columns['author'] = __('Created by');
$new_columns['date'] = _x('Last Action', 'column name');
return $new_columns;
}
add_action('manage_posts_custom_column', 'manage_articles_columns', 10, 2);
function manage_articles_columns($column_name, $id) {
global $wpdb;
switch ($column_name) {
case 'article_thumbnail':
the_post_thumbnail( array(50,50) );
break;
case 'article_excerpt': echo substr(get_the_excerpt(),0,500);
break;
case 'article_source':
echo get_the_term_list($post->ID, 'content_sources', '', ', ','');
break;
default: break;
}
}