分页: 1 / 1

如何在登录小工具中更改仪表盘和配置文件链接

发表于 : 2024年 4月 15日 06:57
Jannah
将此代码添加到子主题的文件中,或通过允许添加自定义函数的插件(例如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;
}