Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个自定义模块来发送包含注册用户数据的邮件。我用过custom_user_register_submit,但我没有得到注册的用户 ID。有什么方法可以在函数中获取用户 ID?
custom_user_register_submit
您可以使用该功能user_load。
user_load
我想,你知道用户登录名(例如“example_user”)。在这种情况下,您可以使用以下代码:
$user_name = "example_user"; $account = user_load(array("name" => $user_name)); $user_id = $account->uid;