public

Changes WordPress "Posts" to be called "News Items" instead.

  • Download Gist
news-items-instead-of-posts.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
<?php
/*
 
news-items-instead-of-posts.php
 
Changes WordPress "Posts" to be called "News Items" instead.
 
Copy this code into your theme's functions.php file.
 
See comments here: http://markjaquith.wordpress.com/2010/11/12/post-formats-vs-custom-post-types/
 
*/
 
add_action('admin_menu','change_post_menu_label');
function change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = 'News Items';
$submenu['edit.php'][5][0] = 'News Items';
$submenu['edit.php'][10][0] = 'Add News Item';
$submenu['edit.php'][16][0] = 'News Item Tags';
echo '';
}
add_action('init','change_post_object_label');
function change_post_object_label() {
global $wp_post_types;
$labels = & $wp_post_types['post']->labels;
$labels->name = 'News Items';
$labels->singular_name = 'News Item';
$labels->add_new = 'Add News';
$labels->add_new_item = 'Add News Item';
$labels->edit_item = 'Edit News Item';
$labels->new_item = 'News Item';
$labels->view_item = 'View News Item';
$labels->search_items = 'Search News Item';
$labels->not_found = 'No News Items found';
$labels->not_found_in_trash = 'No News Items found in Trash';
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.