How Can I put an external link to Wilcity Dashboard?

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'
     );
     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'
     );
     return $aNav;
});
 
  1. Icon: You can use Font Awesome Or Line Awesome
  2. Name: The Name of your Custom Menu Item
  3. Redirect: When clicking on Affiliate, it will redirect to this link.

Leave A Comment?