[英]BuddyPress Xprofile fields to display on “wordpress user edit admin panel”
I am building a buddypress/bbpress, website with xprofile registration fields. 我正在建立一个带有xprofile注册字段的buddypress / bbpress网站。 I am using New User Approve plugin to approve each users manually since we need to check information of each user before they get activated.
我正在使用“新用户批准”插件来手动批准每个用户,因为我们需要在激活每个用户之前检查每个用户的信息。
Problem here is, I am unable to check/view the xprofile field values in Wordpress user edit admin panel. 问题是,我无法在Wordpress用户编辑管理面板中检查/查看xprofile字段值。 All I have is the username change password, changing roles etc. I want the admin panel to display the extra information of the registered user so that I can check the info and approve .
我所拥有的只是用户名更改密码,角色更改等。我希望管理面板显示注册用户的额外信息,以便我可以查看信息并批准。 Anyone can help me out to solve this problem.
任何人都可以帮助我解决这个问题。
Might be similar to this.. haven't tried the code though.... Replace the key value 'xprofile_key_birthday' with actual xprofile keys in Buddypress DB. 可能与此类似。.虽然还没有尝试过代码。...用Buddypress DB中的实际xprofile键替换键值'xprofile_key_birthday'。
Note: This code only displays the values on the edit screen and doesn't insert or update anything. 注意:此代码仅在编辑屏幕上显示值,而不插入或更新任何内容。
<?php
add_action( 'show_user_profile', 'showmy_extra_profile_fields' );
add_action( 'edit_user_profile', 'showmy_extra_profile_fields' );
function showmy_extra_profile_fields( $user ) { ?>
<h3>Extra profile information</h3>
<table class="form-table">
<tr>
<th><label>xprofile_key_birthday</label></th>
<td>
<?php
if( function_exists( 'xprofile_get_field_data' ) ) {
$xprofile_value = xprofile_get_field_data('xprofile_key_birthday', $user->ID );
}
else {
$xprofile_value = '';
}
?>
<input type="text" name="xprofile_key_birthday" id="xprofile_key_birthday" value="<?php echo esc_attr( $xprofile_value ); ?>" class="regular-text" readonly />
</td>
</tr>
</table>
<?php
}
?>
I use the free Wangguard plugin on my BuddyPress/bbPress website. 我在BuddyPress / bbPress网站上使用免费的Wangguard插件 。 All I need to do is click on "Users" in the Wangguard menu on Wordpress dashboard sidebar and then click on "BP Profile" under the member username column.
我需要做的就是单击Wordpress仪表板侧栏上Wangwang菜单中的“用户”,然后单击成员用户名列下的“ BP配置文件”。 I can view and even edit the member profile from there.
我可以从那里查看甚至编辑会员资料。 Hope it helps.
希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.