Php wordpress中用户元的保留键-关于我
有人知道wordpress中保留了哪些元键(我不能用于自己的目的),如果有的话 还有,wordpress关于我的部分。有人知道怎么称呼它吗 提前感谢。发布元键: 您可能不想使用以下post元键:Php wordpress中用户元的保留键-关于我,php,wordpress,key,meta,Php,Wordpress,Key,Meta,有人知道wordpress中保留了哪些元键(我不能用于自己的目的),如果有的话 还有,wordpress关于我的部分。有人知道怎么称呼它吗 提前感谢。发布元键: 您可能不想使用以下post元键: \u缩略图\u id-用于存储特色图像id \u edit\u last-心跳API使用 \u edit\u lock-心跳API使用 \u wp\u page\u template-存储页面模板 \u wp\u附加文件 \u wp\u附件\u元数据 \u菜单项{url,object,object\u
-用于存储特色图像id\u缩略图\u id
-心跳API使用\u edit\u last
-心跳API使用\u edit\u lock
-存储页面模板\u wp\u page\u template
\u wp\u附加文件
\u wp\u附件\u元数据
\u菜单项{url,object,object\u id,target,classes,xfn,…}
名字
姓氏
昵称
说明
rich\u编辑
comment\u快捷方式
admin\u color
jabber
aim
yim
default\u password\u nag
使用ssl
show\u admin\u bar\u front
显示欢迎面板
已删除\u wp\u指针
nav\u菜单\u最近编辑的
managenav菜单列设置
closedpostboxs{post,dashboard,page,…}
metaboxhidden{post,仪表板,页面,…}
meta-box-order{post,dashboard,page,…}
screen\u layout{post,dashboard,page,…}
wp\u功能
wp\u用户级别
wp\u仪表板\u快速\u按\u最后一次\u发布\u id
wp\u用户设置
wp\u用户设置时间
print_r( array_keys( get_user_meta( get_current_user_id() ) ) );
输出如下:
Array
(
[0] => first_name
[1] => last_name
[2] => nickname
[3] => description
[4] => rich_editing
[5] => comment_shortcuts
[6] => admin_color
[7] => use_ssl
[8] => show_admin_bar_front
...cut...
)
查看以获取有关该函数的更多信息
或者只是调查一下您的wp\u usermeta
表
查看每个用户元数据的简单插件:
能够查看每个用户的元数据非常有用,因此让我们为其创建一个简单的插件
以下是用户个人资料/编辑页面的屏幕截图:
下面是代码:
<?php
/**
* Plugin Name: A Simple User Meta Data Viewer
* Description: This plugin allows the site admin to view the metadata for each user, in the edit user screen
* Author: birgire
* Version: 0.0.1
* Plugin URI: http://stackoverflow.com/a/25316090/2078474
*/
add_action( 'show_user_profile', 'birgire_usermeta_list' );
add_action( 'edit_user_profile', 'birgire_usermeta_list' );
function birgire_usermeta_list( $profileuser )
{
if( current_user_can( 'manage_options' ) )
{
// Fetch all the user meta data for current profile user:
$items = get_user_meta( $profileuser->ID );
// Loop:
$rows = '';
foreach( $items as $key => $item )
{
$rows .= sprintf( '
<tr>
<th>%s</th>
<td><input type="text" value="%s" readonly="readonly" class="regular-text" /></td>
</tr>',
$key,
esc_attr( array_shift( $item ) )
);
}
// Output:
printf( '<h3>%s</h3><table class="form-table"><tbody>%s</tbody></table>',
__( 'User Meta' ),
$rows
);
}
}
保留条款:您好,谢谢您的回复。我可以问一下,你知道我在哪里可以看到保留wordpress元键的完整列表吗。我很想看看有什么可以使用。我不确定是否存在这样一个元数据密钥的代码表,但我只是在普通安装上浏览了我的wp\u postemta
表;-)你为什么不给你的元键加前缀呢?啊,对不起,我现在看到你提到的是用户元,而不是post元;-)我将更新答案;-)非常感谢,非常感谢。