试试这个。即使要更改“查看站点”链接,也要删除“站点名称”并在get\\u节点中添加“查看站点”。谢谢
add_action( \'admin_bar_menu\', \'customize_my_wp_admin_bar\', 80 );
function customize_my_wp_admin_bar( $wp_admin_bar ) {
$site_node = $wp_admin_bar->get_node(\'site-name\');
//Change link
$site_node->href = home_url().\'/velkommen\';
//Update Node.
$wp_admin_bar->add_node($site_node);
}