Advertisement
fahimmurshed

Changes WordPress Post labels to Projects

Jul 2nd, 2023
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Change the label of posts
  4.  */
  5. function prefix_change_post_object() {
  6.     $get_post_type = get_post_type_object('post');
  7.     $labels = $get_post_type->labels;
  8.     $labels->name = 'Projects';
  9.     $labels->singular_name = 'Projects';
  10.     $labels->add_new = 'Add Projects';
  11.     $labels->add_new_item = 'Add Projects';
  12.     $labels->edit_item = 'Edit Projects';
  13.     $labels->new_item = 'Projects';
  14.     $labels->view_item = 'View Projects';
  15.     $labels->search_items = 'Search Projects';
  16.     $labels->not_found = 'No Projects found';
  17.     $labels->not_found_in_trash = 'No Projects found in Trash';
  18.     $labels->all_items = 'All Projects';
  19.     $labels->menu_name = 'Projects';
  20.     $labels->name_admin_bar = 'Projects';
  21. }
  22.  
  23. add_action( 'init', 'prefix_change_post_object' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement