Title: superdude's Replies | WordPress.org

---

# superdude

  [  ](https://wordpress.org/support/users/superdude/)

 *   [Profile](https://wordpress.org/support/users/superdude/)
 *   [Topics Started](https://wordpress.org/support/users/superdude/topics/)
 *   [Replies Created](https://wordpress.org/support/users/superdude/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/superdude/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/superdude/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/superdude/engagements/)
 *   [Favorites](https://wordpress.org/support/users/superdude/favorites/)

 Search replies:

## Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Accessing a custom capability](https://wordpress.org/support/topic/accessing-a-custom-capability/)
 *  Thread Starter [superdude](https://wordpress.org/support/users/superdude/)
 * (@superdude)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/accessing-a-custom-capability/#post-774237)
 * i am actually, then i run a query in my custom php page to see if a user has 
   that capability in it, and if there is, i set my new php page to provide the 
   functionality based on that only. My whole plan is to create a new page, which
   is a link from my plugin on the main page, i pass the users variables to my new
   page, and then use the id to check in the db in that wp_usermeta table if they
   have the capability by checking for those values. I dont understand or am still
   getting to grips with how wordpress works, let alone php. I am 3 weeks into it
   from no experience. I am going to look over what you have said about he current
   user function and try to understand it like you guys do and get it done that 
   way.
 * thanks a mil for your help man! 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Accessing a custom capability](https://wordpress.org/support/topic/accessing-a-custom-capability/)
 *  Thread Starter [superdude](https://wordpress.org/support/users/superdude/)
 * (@superdude)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/accessing-a-custom-capability/#post-774195)
 * AFter some many hours of frustrating investigating, i found my answer. There 
   is a table called “wp_usermeta”, in there find the id of the person you are interested
   in. now if you have given them permissions to the custom capability you created,
   it will reflect here. this is where you will find it.
    1. Use sqlyog or whatever
   and run “select * from wp_usermeta” on the db 2. Then locate the user_id 3. look
   at the column named “meta_key” and look for “wp_capabilities”. 4. Now next to
   it the is a column named “meta_value”. 5. In my example above, my custom capability
   is “Hbpediapublisher” and “Hbpediaeditor”, and since i have allowed this user
   that capabilities, you will see “a:3:{s:13:”hbpediaeditor”;b:1;s:16:”hbpediapublisher”;
   b:1;s:13:”administrator”;b:1;}”
 * If they where not given those capabilities, you will see something like
    “a:1:{
   s:13:”administrator”;b:1;}”.
 * Hope this helps someone who was as lost as i.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [creating custom capability with role manager fails](https://wordpress.org/support/topic/creating-custom-capability-with-role-manager-fails/)
 *  [superdude](https://wordpress.org/support/users/superdude/)
 * (@superdude)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/creating-custom-capability-with-role-manager-fails/#post-706238)
 * Hello, i can create a custom capability, and assign it to a role no problem. 
   Now i am trying to do the following And it doesnt work, can anyone help, how 
   do i access this custom capability. Basically what i want to do is check if a
   user has that capability assigned to him or not, and then i am going to use if
   else statements like below to set a value depending on whether he have access
   or not and return that value somewhere else and do whatever i like with it, has
   anyone done this? I have search far and wide, no luck :(.
 *  if ( current_user_can(‘Hbpediapublisher’) )
    { $myHbPediaLevel = “12”; } elseif(
   current_user_can(‘Hbpediaeditor’) ) { $myHbPediaLevel = “11”; } ?> </p> </form
   >

Viewing 3 replies - 1 through 3 (of 3 total)