Please add the following code to functions.php of Wilcity Child (after <?php syntax )
add_filter('wilcity/dashboard/navigation', function($aNav){
$aNav['affiliate'] = array(
'name' => 'Affiliate',
'icon' => 'la la-shopping-cart',
'redirect' => 'https://google.com',
'externalLinkTarget' => '_blank' // _self to open link in the same frame
);
return $aNav;
});
In case, If you don’t want to show this link on Subscriber dashboard, please use this code
add_filter('wilcity/dashboard/navigation', function($aNav){ if ( !is_user_logged_in() ) { return $aNav; } $oUser = wp_get_current_user(); if ( in_array( 'subscriber', (array) $oUser->roles ) ) { return $aNav; } $aNav['affiliate'] = array( 'name' => 'Affiliate', 'icon' => 'la la-shopping-cart', 'redirect' => 'https://google.com', 'externalLinkTarget' => '_blank' ); return $aNav; });
- Icon: You can use Font Awesome Or Line Awesome
- Name: The Name of your Custom Menu Item
- Redirect: When clicking on Affiliate, it will redirect to this link.