Skip Navigation

[Resolved] wpv-current-user info="role" not always working (depending on db value)

This support ticket is created 6 years, 5 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.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 5 months ago.

Author
Posts
#907459

I use [wpv-current-user info="role"] in combination with [wpv-conditional] and noticed this does'n work always, even if users have the same role. When a user is logged in where it doesnt work, [wpv-current-user info="role"] also doesn't have any output (empty). Another user with the same role, gives the correct output

I noticed that the _capabilities value in the _usermeta database was different for two users I tested with.

Working db value when conditional testing on role "lid_entree":
a:1:{s:10:"lid_entree";b:1;}

Not working db value with a user who had the same role according to the WP admin screen:
a:2:{s:13:"lid (entrée)";b:1;s:10:"lid_entree";b:1;}

Roles are created using Toolset Access and users are created using Gravity forms, but updated to another role just using the WP users admin screen.

The WP user admin screens is showing the role correctly. Is [wpv-current-user] not reading the _capabilities correctly?

#907695

Well, as it seems the 2 users present different stored data, one is likely corrupted or wrong, the other correct.

If you create a new user in the backend of that role, does that user work?
If you create a new user with your custom process, does it work?

I suspect some plugin or process you use to alter the users creates this problem.

I as well see that you still use the outdated Plugins of Toolset, it may be good to update them, just to exclude any conflict.

To confirm the issue I would need the exact steps you follow and the software you use to create the users who present those issues.
Once we have that we can try to replicate this and see if it is on Toolset, either while creating the data or getting it.
But I strongly suspect, given your description, that there is some interfering process or code.