Get User Custom Field Values

0

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 u

Version
Last updated
Active installations
WordPress Version
Tested up to
Rating
Total ratings
Tags
This plugin is outdated and might not be supported anymore.

Description

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.