繁体   English   中英

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

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM