AnsPress 2.0 – Add icon class in user nav menu

5.47K viewsCore
0

Hi,

In anspress-master\includes\user.php the user-profile page is rendered and each tab in the menu is rendered by this code:

$o .= '<li'.( $user_page == $k ? ' class="active"' : '' ).'>
   <a href="'. $m['link'] .'" class="ap-user-menu-'.$k.$class.'">'.$m['title'].'</a>
</li>';

This is near line 604 in https://github.com/wp3/anspress/blob/master/includes/user.php.
I would like a change in this rendering because the current implementation has issues when you add a custom tab and use a font-awesome icon as tab-icon. Since the icon class is applied to the anchor tag, the font of the link text is affected by the font-awesome style. So could you please change the tab rendering to something like this:

$o .= '<li'.( $user_page == $k ? ' class="active"' : '' ).'>
   <a href="'. $m['link'] .'" class="ap-user-menu-'.$k.'"><i class="'.$class.'"></i>'.$m['title'].'</a>
</li>';

So I added a container for the icon.
Only remaining issue with this replacement code is that it does not add a space between the icon and the link text. Though that should be handled in CSS (I think) and I’m not an expert in that area, so I leave that to people with more experience 🙂

Thanks,
Michiel

0

Hi Rahul,

Can you tell me if this is also on the road-map of the ‘Profile Extention’ ?

Thanks!

You are viewing 1 out of 2 answers, click here to view all answers.