本文整理汇总了PHP中BYT_Theme_Utils::activation_success_notification方法的典型用法代码示例。如果您正苦于以下问题:PHP BYT_Theme_Utils::activation_success_notification方法的具体用法?PHP BYT_Theme_Utils::activation_success_notification怎么用?PHP BYT_Theme_Utils::activation_success_notification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BYT_Theme_Utils
的用法示例。
在下文中一共展示了BYT_Theme_Utils::activation_success_notification方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activate_user
public static function activate_user($user_id, $activation_key)
{
$user = get_userdata($user_id);
$user_activation_key = get_user_meta($user_id, 'user_activation_key', true);
if ($user && !empty($user_activation_key) && $user_activation_key === $activation_key) {
// change user role from pending
$user_can_frontend_submit = get_user_meta($user->ID, 'user_can_frontend_submit', true);
$userdata = array('ID' => $user->ID);
if ($user_can_frontend_submit) {
$userdata['role'] = BOOKYOURTRAVEL_FRONTEND_SUBMIT_ROLE;
} else {
$userdata['role'] = get_option('default_role');
}
wp_update_user($userdata);
delete_user_meta($user_id, 'user_activation_key');
delete_user_meta($user_id, 'user_can_frontend_submit');
BYT_Theme_Utils::activation_success_notification($user_id);
return true;
} else {
return false;
}
}