最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

users - Is there any way to access Ultimate Member's custom fields?

programmeradmin1浏览0评论

Ultimate User allows you to create custom fields in the register page. I have added address and phone. Where do they go? You cannot edit or even find them in the back end user interface. I added them so that they could appear in the user directory listings and cannot find any way to edit that listing or find the fields.

Ultimate User allows you to create custom fields in the register page. I have added address and phone. Where do they go? You cannot edit or even find them in the back end user interface. I added them so that they could appear in the user directory listings and cannot find any way to edit that listing or find the fields.

Share Improve this question asked Jun 21, 2018 at 19:18 mkstlwtzmkstlwtz 1411 gold badge1 silver badge5 bronze badges 1
  • 1 They probably go in the user meta table if it's data specific to a user. I imagine the documentation for that plugin will tell you what the key names are, or you can use get_user_meta to fetch all meta data for a user, which will also tell you what keys the data is stored under. – Milo Commented Jun 22, 2018 at 3:29
Add a comment  | 

4 Answers 4

Reset to default 2

I can confirm that the values are saved in the User meta table as I have been working on the same exact thing. meta_key contains the name of the input (case sensitive) and meta_value the actual value. User-ID is also a column, so, theoretically, you can get all the values for a certain user. I'm still working on this query so I can get the data for each user on a row. We are also using the paid plug-in WP Data Tables to display the data from Ultimate Member.

Custom fields are recorded by Ultimate Member in the wp_usermeta table in this form:

So you can get the value of a custom field by using get_user_meta() function:

echo get_user_meta( $user_id, $field_id, true );

Follow this link, https://gist.github/magnific0/29c32c7dabc89ab9cae5, and it will show you how to adjust your functions.php file in your themes folder to show the custom UM metadata under the user menu.

works like a charm :)

Ultimate Member has a function you can use to get the user meta data.

It is: um_user()

Usage:

<?php echo um_user( $data ); ?>

Example:

<?php 
$custom_field_name = um_user('your_custom_field_name');
echo $custom_field_name; // prints the custom field data
?>
发布评论

评论列表(0)

  1. 暂无评论