Landing › Forums › Somentra (Impeka) › Feedback › Rename Portfolio › Reply To: Rename Portfolio
August 9, 2021 at 3:18 pm
#431
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.

