The field shortcode can be used to display any of the registration fields for a logged in user. The field parameter corresponds to that field’s option name (found in the WP-Members Fields option tab; this is also the usermeta).
The field shortcode can also be used to display data about other users. This can be passed in an “id” field. The id must be either the numeric user ID of a specific user or “get” to indicate that the user ID will be passed through a querystring as “uid” (i.e. http://yoursite/your-page/?uid=123)
Note: As of 3.1.5 you no longer need to give the field=”some_field” attribute. The field’s meta key can be used alone.
Display the user’s username:
[wpmem_field user_login] (3.1.5+)
Display the user’s first name last name:
[wpmem_field first_name] [wpmem_field last_name] (3.1.5+)
[wpmem_field field="first_name"] [wpmem_field field="last_name"]
Display email for a specific user (ID=123):
[wpmem_field user_email id="123"] (3.1.5+)
[wpmem_field field="user_email" id="123"]
Display first name/last name for an ID passed through a querystring (uid):
[wpmem_field first_name id="get"] [wpmem_field last_name id="get"] (3.1.5+)
[wpmem_field field="first_name" id="get"] [wpmem_field field="last_name" id="get"]
Additional Attributes (3.1.5+)
There are some additional attributes that can be used, primarily for specific field types.
Select (dropdown), Multiple Select, Multiple Checkbox, and Radio Fields:
These fields generally have a different saved (stored) value than what is displayed to the user (such as the case of a dropdown select field). As of 3.1.4, the shortcode was changed to display the “display” value of the field rather than the saved value. However, in cases where the saved value is needed, you can add the attribute display=raw to the shortcode. The following example would display the raw/saved value for the field my_dropdown:
[wpmem_field my_dropdown display=raw]
Image and File Fields:
Previous to version 3.1.5, the shortcode would display the raw value of the the field for these field types. These field types use the WP post type “attachment” so the value is actually the post ID of the file.
In 3.1.5, this changes to actually display either a link to the file or to display the image (depending on the field type). If this raw ID value is desired, then the attribute display=raw can be used.
[wpmem_field my_file display=raw] would display the post ID for the file.
A “file” field type will display a link to the file, using the title parameter from the post.
An “image” field type will display a thumbnail of the image. This can be changed using the “size” attribute. The value can be the following:
[wpmem_field my_image size=medium] would display the medium size of the image my_image
[wpmem_field my_image size="100,200"] would display the image my_image at a size of 100px wide by 200px high
A (not fully exhaustive) List of Parameters from the default install:
WP Default Fields:
WP-Members Default Fields:
In addition to the above list:
Any fields that you might add to the plugin’s registration process can be displayed in this same way. The value you give to the Option Name is the parameter that you would use. [See Choosing Fields for how to set up custom fields in the plugin registration]