![](/img/trans.png)
[英]BuddyPress Xprofile fields to display on “wordpress user edit admin panel”
[英]BuddyPress Xprofile fields to display on “wordpress user edit admin panel”
我正在建立一個帶有xprofile注冊字段的buddypress / bbpress網站。 我正在使用“新用戶批准”插件來手動批准每個用戶,因為我們需要在激活每個用戶之前檢查每個用戶的信息。
問題是,我無法在Wordpress用戶編輯管理面板中檢查/查看xprofile字段值。 我所擁有的只是用戶名更改密碼,角色更改等。我希望管理面板顯示注冊用戶的額外信息,以便我可以查看信息並批准。 任何人都可以幫助我解決這個問題。
可能與此類似。.雖然還沒有嘗試過代碼。...用Buddypress DB中的實際xprofile鍵替換鍵值'xprofile_key_birthday'。
注意:此代碼僅在編輯屏幕上顯示值,而不插入或更新任何內容。
<?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
}
?>
我在BuddyPress / bbPress網站上使用免費的Wangguard插件 。 我需要做的就是單擊Wordpress儀表板側欄上Wangwang菜單中的“用戶”,然后單擊成員用戶名列下的“ BP配置文件”。 我可以從那里查看甚至編輯會員資料。 希望能幫助到你。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.