Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在wordpress用户表中添加自定义数据_Php_Mysql_Wordpress - Fatal编程技术网

Php 如何在wordpress用户表中添加自定义数据

Php 如何在wordpress用户表中添加自定义数据,php,mysql,wordpress,Php,Mysql,Wordpress,我尝试使用wordpress社交登录插件做一些事情。我需要将steamid放入wp\u用户表中。我必须在wp\u users表中创建名为steamid的列 尝试使用以下工具: $userdata = array( 'user_login' => $user_login, 'user_email' => $user_email, 'display_name' => $user_login, 'first_name' =&g

我尝试使用wordpress社交登录插件做一些事情。我需要将
steamid
放入
wp\u用户
表中。我必须在
wp\u users
表中创建名为
steamid
的列

尝试使用以下工具:

$userdata = array(
    'user_login'    => $user_login,
    'user_email'    => $user_email,

    'display_name'  =>  $user_login,

    'first_name'    => $hybridauth_user_profile->firstName,
    'last_name'     => $hybridauth_user_profile->lastName,
    'user_url'      => $hybridauth_user_profile->profileURL,
    'description'   => $hybridauth_user_profile->description,
    'steamid'   => $user_login,

    'user_pass'     => wp_generate_password()
);

但是什么也没有,表列
steamid
仍然是空的。怎么了?

您不需要修改数据库,您可以使用它:与您的问题无关,但我认为它仍然值得一提:通常您应该将这些附加字段保存在
usermeta
表中,这就是它的用途(在不修改
user
表的情况下存储附加用户数据)谢谢回复!我知道usermeta,但我需要保存在“wp_用户”中: