本文整理匯總了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;
}
}