0
我目前正在尝试为更新所有用户帐户(5000+)的名字,姓氏和邮编的Wordpress网站创建一个PHP脚本。更新的数据正在从所有用户在注册期间填写的表单中进行的单独查询中提取。我的问题实际上并没有更新用户,我可以毫无问题地做到这一点。问题是在HTTP请求超时之前更新所有5000多个用户。一两分钟后,我发送到一个页面,其中显示“HTTP错误504 - 网关超时”。一些用户数据已经更新,但我希望所有这些都是这样。WordPress的更新用户功能超时
我正在运行for循环来完成此任务。以下是运行更新的代码部分。
for ($x = 0; $x <= $total_registers; $x++) {
$first_name = $registers[$x]["2.3"];
$last_name = $registers[$x]["2.6"];
$profile_zipcode = $registers[$x]["18"]
$main_id = $registers[$x]["created_by"];
$user_update = wp_update_user(array('ID' => $main_id, 'first_name' => $first_name, 'last_name' => $last_name, $profile_zipcode => 'profile_zipcode'));
}
有没有人知道如何实现这个没有超时错误?
谢谢!
'$ profile_zipcode =>'profile_zipcode''它应该不是''profile_zipcode'=> $ profile_zipcode'? – Benoti
啊,你是对的!但不幸的是,这并没有解决我最初的问题。感谢您指出了这一点。 – gabed123