Created
November 29, 2021 17:55
-
-
Save robwent/b4df7d4dd93d72cb0c4aa27ce32070b4 to your computer and use it in GitHub Desktop.
Changes WordPress Post labels to Projects
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 | |
/** | |
* Change the label of posts | |
*/ | |
function prefix_change_post_object() { | |
$get_post_type = get_post_type_object('post'); | |
$labels = $get_post_type->labels; | |
$labels->name = 'Projects'; | |
$labels->singular_name = 'Projects'; | |
$labels->add_new = 'Add Projects'; | |
$labels->add_new_item = 'Add Projects'; | |
$labels->edit_item = 'Edit Projects'; | |
$labels->new_item = 'Projects'; | |
$labels->view_item = 'View Projects'; | |
$labels->search_items = 'Search Projects'; | |
$labels->not_found = 'No Projects found'; | |
$labels->not_found_in_trash = 'No Projects found in Trash'; | |
$labels->all_items = 'All Projects'; | |
$labels->menu_name = 'Projects'; | |
$labels->name_admin_bar = 'Projects'; | |
} | |
add_action( 'init', 'prefix_change_post_object' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment