Risolto!
Tentavo un hook verso la funzione sbagliata, ho agito su wp_nav_menu_objects.
Ecco il codice:
function ravs_add_menu_parent_class( $items ) {
if (is_user_logged_in())
{
$link_profile = array (
'title' => 'Profilo',
'menu_item_parent' => 937,
'ID' => '34343434343434343434',
'db_id' => '34343434343434343434',
'url' => bbp_get_user_profile_url( get_current_user_id() ),
);
$items[] = (object) $link_profile;
$link_logout = array (
'title' => 'Logout',
'menu_item_parent' => 937,
'ID' => '12121212121212121212',
'db_id' => '12121212121212121212',
'url' => wp_logout_url(),
);
$items[] = (object) $link_logout;
}
return $items;
}
add_filter( 'wp_nav_menu_objects', 'ravs_add_menu_parent_class' );
Magari può essere utile a qualcuno.