iXiNX Club主要为自用型文档社区,同时也开放共用文档,欢迎爱好者加入并共享内容,翻译文档
iXiNX Club开放性测试进行中,欢迎体验反馈,如有任何问题均可联系管理员
LV2
如何在登录小工具中更改仪表盘和配置文件链接
将此代码添加到子主题的文件中,或通过允许添加自定义函数的插件(例如Code snippets插件)添加。避免将自定义代码直接添加到父主题的文件中,因为当您更新主题时,这将被完全擦除。functions.php

https://dashboard-custom-linkhttps://profile-custom-link 替换为您自己的自定义链接

代码: 全选

add_filter( 'TieLabs/Login/links', 'theme_custom_login_links' );
function theme_custom_login_links( $links ) {

	if( current_user_can( 'manage_options' ) ){
		$links['dashboard']['link'] = 'https://dashboard-custom-link';
	}
	
	$links['profile']['link'] = 'https://profile-custom-link';

	return $links;
}

信息