BuddyPress Xprofile字段显示在“wordpress用户编辑管理面板”上

时间:2013-09-05 13:19:53

标签: wordpress field admin buddypress

我正在建立一个带有xprofile注册字段的buddypress / bbpress网站。我正在使用New User Approve插件手动批准每个用户,因为我们需要在激活之前检查每个用户的信息。

问题在于,我无法在Wordpress用户编辑管理面板中检查/查看xprofile字段值。我所拥有的只是用户名更改密码,更改角色等。我希望管理面板显示注册用户的额外信息,以便我可以查看信息并批准。任何人都可以帮助我解决这个问题。

2 个答案:

答案 0 :(得分:0)

可能与此相似..虽然没有尝试过代码.... 将键值'xprofile_key_birthday'替换为Buddypress DB中的实际xprofile键。

注意:此代码仅在编辑屏幕上显示值,不会插入或更新任何内容。

<?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 
}
?>

答案 1 :(得分:0)

我在BuddyPress / bbPress网站上使用免费Wangguard plugin。我需要做的就是点击&#34;用户&#34;在Wordpress仪表板侧栏上的Wangguard菜单中,然后点击&#34; BP Profile&#34;在成员用户名栏下。我可以从那里查看甚至编辑成员资料。希望它有所帮助。

相关问题