我已经添加并使用了来自 user_custom_hash
的 USERMETA 字段(称为: wp_usermeta
) table 。意思是我去过 Insert
/Edit
/Deleting
某处代码中的字段。
之前不需要显示出来。
所以现在..
USERMETA
Wordpress 管理仪表板的“用户配置文件”页面上的字段? (我的意思是管理仪表板上的“编辑用户”页面。)例如:
Custom Hash Key: __239cc68ba2423ddf67dcfcd4aa2fa83b__
我的意思是,在这里的某个地方展示:
Note:
Wordpress Version currently: 3.5.0
最佳答案
现在可以了,因为我自己拿到了,就像这样:
add_action( 'show_user_profile', 'display_user_custom_hash' );
add_action( 'edit_user_profile', 'display_user_custom_hash' );
function display_user_custom_hash( $user ) { ?>
<h3>USERMETA Fields</h3>
<table class="form-table">
<tr>
<th><label>Custom Hash Key</label></th>
<td><input type="text" value="<?php echo get_user_meta( $user->ID, 'user_custom_hash', true ); ?>" class="regular-text" readonly=readonly /></td>
</tr>
</table>
<?php
}
functions.php
的底部我当前主题文件夹的文件。 注:后 上面的整个代码应该是正常的
?>
像以前一样对整个文件进行处理。
关于Wordpress 在用户配置文件仪表板上显示自定义 USERMETA 字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16933131/