Results 1 to 1 of 1
-
10th Oct 2012, 10:05 PM #1OPMember
Weird problem while trying to add functionality to Members Directory plugin
Hello everybody!
I'm trying to edit Members Directory plugin so it shows user role along with website, name and bio.
Code:
Code:Get user id: $user_idd = $user_details->ID; Get role of that user: $user_current = new WP_User( $user_idd ); $role_container = $user_current->roles; Display user role: $content .= '<strong>' . __('Rank') . '</strong>: ' . $role_container[0] . '<br />';
For some reason this code works only if the user is administrator. So, if user is administrator, then this code is creating line: "Rank: administrator". But, if user have any other rank, then $role_administrator is an empty string so I get: "Rank: ".
At first, I thought that the code placement is wrong, but I've tried to print $user_idd instead of $role_container[0], and I'm getting expected output(different id printed on different profiles).
Also weird - While desperately searching for solution, I've even tried to get user level(which is deprecated) instead of user role - and I'm getting the same problem - user level displays only for administrator
Any ideas ?
*Note - Source says that this is a free software under the GNU licence, so I can add the code of the whole plugin here if that helps.
Thank you.Cojba Reviewed by Cojba on . Weird problem while trying to add functionality to Members Directory plugin Hello everybody! I'm trying to edit Members Directory plugin so it shows user role along with website, name and bio. Code: Get user id: $user_idd = $user_details->ID; Get role of that user: Rating: 5HQLessons.Net + HQLessons.Com + 8months of HQ shared hosting - 30$
Selling two themaPosters for 25$ or 15$ for each. Payza(AP) only. Contact me :)
Respected and trusted members: wf?9, Jimmy, ramicn, Matijasevic, rkze1
Cheap desktop apps development. Contact via pm or msn.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Directory Problem
By __Doc_ in forum Webmaster DiscussionReplies: 0Last Post: 11th Jan 2011, 10:01 PM -
paypal weird problem
By accyuklad in forum PaypalReplies: 6Last Post: 4th Nov 2010, 05:50 AM -
vb help weird problem !
By MacLoving in forum vBulletinReplies: 16Last Post: 12th Feb 2010, 05:59 PM -
[HELP] Weird Problem w/ Computer
By MagicTallGuy in forum Tutorials and GuidesReplies: 10Last Post: 22nd Nov 2009, 06:38 AM
themaLeecher - leech and manage...
Version 4.94 released. Open older version (or...