Get User Custom Field Values

plugin banner

Version: 2.6

Easily retrieve and control the display of any custom field values/meta data for the currently logged in user or any specified user.

Author:Scott Reilly (profile at wordpress.org)
WordPress version required:4.6
WordPress version tested:5.8.2
Plugin version:3.3
Added to WordPress repository:08-08-2011
Last updated:21-11-2021
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:74
Rated by:3
Plugin URI:https://coffee2code.com/wp-plugins/get-user-c...
Total downloads:12 365
Active installs:100+
plugin download
Click to start download

This plugin provides a powerful widget, shortcode (with shortcode builder tool), and template tags for easily retrieving and displaying custom field values for the currently logged in user or any specified user.

This plugin provides functionality similar to the Get Custom Field Values plugin, but for user custom fields (which WordPress manages in a separate database table).

This plugin does NOT help you in setting user custom field values, nor does it provide an interface to list or otherwise manage user custom fields.

The list of useful user custom field values that are provided by default in WordPress are:

  • first_name
  • last_name
  • nickname
  • description
  • aim
  • yim
  • jabber

It is up to other plugins or custom code to add additional user custom fields that you may then be able to retrieve with this plugin.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Developer Documentation

Developer documentation can be found in DEVELOPER-DOCS.md. That documentation covers the numerous template tags, hooks, and shortcode provided by the plugin.

As an overview, these are the template tags provided the plugin:

  • c2c_get_current_user_custom() : Template tag to get custom fields for the currently logged in user.
  • c2c_get_author_custom() : Template tag to get custom fields for the current author (when on the permalink page for a post, page, or in a loop).
  • c2c_get_user_custom() : Template tag to get custom fields for a specified user.

These are the hooks provided by the plugin:

  • c2c_get_current_user_custom : An alternative approach to safely invoke c2c_get_current_user_custom() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
  • c2c_get_author_custom : An alternative approach to safely invoke c2c_get_author_custom() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
  • c2c_get_user_custom : An alternative approach to safely invoke c2c_get_user_custom() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
  • c2c_get_user_custom_field_values_shortcode : Filter to customize the name of the plugin’s shortcode.
  • c2c_get_user_custom-user_field_proxy : Filter to prevent proxying to user object fields if no value for the custom field was found for the user.
  • get_user_custom_field_values/can_author_use_shortcodes : Filter to customize if post author can make use of the ‘user_custom_field’ shortcode.
  • get_user_custom_field_values/show_metabox : Filter to customize if the shortcode builder metabox is shown.

The shortcode provided is [user_custom_field], which has a number of attributes to customize its behavior and output.


Screenshots
FAQ
ChangeLog