© 2021 Greatives Hub - Powered by Greatives & Greatives Web

Reply To: Rename Portfolio

Landing Forums Impeka Feedback Rename Portfolio Reply To: Rename Portfolio

#431
Marius1989
Participant
Hub Member Badge

Alright, I quickly threw something together:

function give_your_function_a_custom_name_or_whatever() {
  global $menu; // set a global to get the wp admin menu array
  global $submenu; // set a global to get access to the submenu array

  $menu[6][0] = 'People'; // change "Portfolio" to "People"
  $menu[6][6] = 'dashicons-businessperson'; // change icon, you can pick another one that fits your needs more here: https://developer.wordpress.org/resource/dashicons/
  $submenu['edit.php?post_type=portfolio'][5][0] = 'Overview'; // change "Portfolio Items" to "Overview"
  $submenu['edit.php?post_type=portfolio'][10][0] = 'Add Person'; // change "Add New" to "Add Person"
  $submenu['edit.php?post_type=portfolio'][15][0] = 'People Fields'; // change "Portfolio Categories" to "People Categories"
  $submenu['edit.php?post_type=portfolio'][16][0] = 'People Categories'; // change "Portfolio Fields" to "People Fields"
}
add_action( 'admin_menu', 'give_your_function_a_custom_name_or_whatever' );

If you want the changes only on the editor role appear, wrap the above code inside the following one:

if (current_user_can('editor')) {
  
//here goes the code from above

} 

Tell me if there is anything else you still need.