bfoley00
Forum Replies Created
-
@richpearce I consider this issue resolved for myself. I’m leaving it open in case the update didn’t work for you. If it did, you can go ahead reply and mark this issue as resolved.
@rohitkalra I haven’t explored the registration feature in Ultimate Member. You may want to start a new thread with your question, and a really descriptive subject line, so that others may see it.
An update was just released. I tested the update button and it no longer wipes out the role display name. Thank you to the developers at UM for a quick resolution!
Unfortunately, those who were affected will still need to manually restore the deleted display names. The process I described at the beginning of this post worked for me. It did make me very nervous to edit the database directly because one typo can really mess things up but if you are VERY CAREFUL and meticulous, it does work.
@rohitkalra rather than coding a work around, I would update UM and then manually restore the deleted names.
Are you asking how to get the role of a user based on their username? To do that you first retrieve the user data and then look at the roles.
$user_login = ’employer’;
$user = get_user_by( ‘login’, $user_login );
if ( ! empty( $user ) ) {
$user_roles = $user->roles;
global $wp_roles;
foreach($user_roles as $role) {
$role_slug = $role;
$role_label = $wp_roles->roles[$role][‘name’];
echo ‘<div>Role: ‘.$role_label.’ (‘.$role_slug.’)</div>’;
}
}Try using get_user_by()
https://developer.wordpress.org/reference/functions/get_user_by/
Do you have any thoughts as to why I don’t have a My Custom Tab checkbox under UM->Settings->Appearances->Profile Menu ?
I really need to restore my custom tabs as soon as possible.
Thank you for your response. It makes sense. However, it looks like I don’t have a way to manage the “My Custom Tab” setting.
Under UM->Settings->Appearances->Profile Menu
I DO NOT see settings for:
Forums Tab
My Custom Tab
Badges TabI DO see settings for:
Enable profile menu
About Tab
Posts Tab
Comments Tab
Purchases Tab
Product Reviews Tab
Profile menu default Tab
Enable menu icons in desktop view(I also have the UM WooCommerce 2.1.7 extension installed.)
An update for the WooCommerce for UM extension was released at the same time as the UM update. The purchases tab displays as expected on the profile menu.
Could the Profile Tabs Privacy settings bug fix have affected whether my custom tabs display?
This is my code:
// Filter
function um_mycustomtab_add_tab( $tabs ) {
$tabs[‘mycustomtab’] = array(
‘name’ => ‘My Custom Tab’,
‘icon’ => ‘um-faicon-pencil’,
‘custom’ => true
);
return $tabs;
}
add_filter( ‘um_profile_tabs’, ‘um_mycustomtab_add_tab’, 1000 );// Action
function um_profile_content_mycustomtab_default( $args ) {
echo ‘Hello world!’;
}
add_action( ‘um_profile_content_mycustomtab_default’, ‘um_profile_content_mycustomtab_default’);