WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Get User Custom Field Values

Use a widget, shortcode, and/or template tags to easily retrieve and display custom field values for the currently logged in (or any specific) user.

  1. Unzip get-user-custom-field-values.zip inside the /wp-content/plugins/ directory (or install via the built-in WordPress plugin installer)
  2. Activate the plugin through the 'Plugins' admin menu in WordPress
  3. (Optional) Add filters for 'the_user_meta' to filter user custom field data (see the end of the file for commented out samples you may wish to include). And/or add per-meta filters by hooking 'the_user_meta_$field'
  4. Give a user a custom field with a value, or have user custom fields already defined. (This generally entails use of plugin(s) that utilize the user custom fields feature built into WordPress. By default, in a practical sense WordPress only sets the 'first_name', 'last_name', and 'nickname' user custom fields, so you could try using one of them, even if just for testing even though WordPress provides functions to get those particular fields.)
  5. Use the provided 'Get User Custom' widget -or- Use the available shortcode in a post or page -or- Use the function c2c_get_current_user_custom() if you wish to access user custom fields for the currently logged in user. Use the function c2c_get_user_custom() to access user custom fields for a specified user. User the function
c2c_get_author_custom()

to access custom fields for the current author (when on the permalink page for a post, page, or in a loop). Prepend either of the three mentioned functions with 'echo' to display the contents of the custom field; or use the return value as an argument to another function.

Requires: 3.6 or higher
Compatible up to: 3.8.3
Last Updated: 2014-1-18
Downloads: 4,540

Ratings

4 stars
4 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,2,0 100,2,2
100,1,1
100,1,1