Skip Navigation

[Resolved] wpv-current-user not display role for one admin user

This thread is resolved. Here is a description of the problem and solution.

Problem:
wpv-current-user not display role for one admin user

Solution:
This is again an exception.

You can find the proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/wpv-current-user-not-display-role-for-one-admin-user/#post-1238543

Relevant Documentation:

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by KentS9937 5 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1237972

I am trying to use wpv-current-user to display the currently logged in user's role. This is working for all users I've tested except for one admin user. It display nothing for the role for this one particular admin. For other admin users it correctly displays the administrator role. What would keep it from display any role for one admin user?

wpv-current-user role = [wpv-current-user format="meta" info="role"]
#1238024

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I checked with my test install and I used the following shortcode to display the current user role:

[wpv-current-user info="role"]

Can you please check if above shortcode help you to resolve your issue otherwise it should be an exception as you acknowledge that the shortcode works for all other users excluding one specific user.

#1238184

I tried the code you recommended and saw the same result. It's displaying the correct user role for all user's except my primary admin account.

#1238189

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is really strange and I do not able to reproduce this issue. There is something strange happening on your install.

Please take the basic debug steps;
Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?

or

Send me the access details where you added the shortcode so I'll try to check what's going on with your setup.

I have set the next reply to private which means only you and I have access to it.

#1238543

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - there is something strange going with your site.

When I see the capabilities within database for the user "smythe" I see following:
- I see that you may have installed the plugin "User Role Editor" and later on deactivate it

a:13:{s:26:"wpcf_custom_post_type_view";b:1;s:26:"wpcf_custom_post_type_edit";b:1;s:33:"wpcf_custom_post_type_edit_others";b:1;s:25:"wpcf_custom_taxonomy_view";b:1;s:25:"wpcf_custom_taxonomy_edit";b:1;s:32:"wpcf_custom_taxonomy_edit_others";b:1;s:22:"wpcf_custom_field_view";b:1;s:22:"wpcf_custom_field_edit";b:1;s:29:"wpcf_custom_field_edit_others";b:1;s:25:"wpcf_user_meta_field_view";b:1;s:25:"wpcf_user_meta_field_edit";b:1;s:32:"wpcf_user_meta_field_edit_others";b:1;s:13:"administrator";b:1;}

I changed that to which is normal capability with new user added as administrator:

a:1:{s:13:"administrator";s:1:"1";}

If you visit now the page - I can see its displaying the administrator: hidden link

Can you please confirm it works as your end as well.

#1238701

Thank you. That did fix the problem. I'm still puzzled why other Admins didn't have a problem as the user role definitions and capabilities were intended to be the same for all admins. But maybe I inadvertently change something on the one admin. Thanks for helping me spot the problem.