Created
November 12, 2010 09:58
-
-
Save mikeschinkel/673931 to your computer and use it in GitHub Desktop.
Changes WordPress "Posts" to be called "News Items" instead.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment