Title: Difference between using get_userdata in a plugin and in a shortcode
Last modified: August 30, 2016

---

# Difference between using get_userdata in a plugin and in a shortcode

 *  [websolad](https://wordpress.org/support/users/websolad/)
 * (@websolad)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/difference-between-using-get_userdata-in-a-plugin-and-in-a-shortcode/)
 * Why is there a difference between using get_userdata in a plugin-code (and do
   a print_r to a logfile) and in a shortcode (and output it to the content)
 * The difference is in the caps and roles:
 * In the plugin i get only the first role and in the shortcode i get the hole list,
   which is given by the ure plugin…
 * Can any one help me, how to get the list of roles in the plugin too?
 * thx
 * [https://wordpress.org/plugins/user-role-editor/](https://wordpress.org/plugins/user-role-editor/)

The topic ‘Difference between using get_userdata in a plugin and in a shortcode’
is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [websolad](https://wordpress.org/support/users/websolad/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/difference-between-using-get_userdata-in-a-plugin-and-in-a-shortcode/)
 * Status: not resolved