Default value for checkbox field not populating with the value placed in "default" field of field form.
Expected checkbox to have one check initialized when a new account is created.
public function triggerProfileUpdate($user,&$data,$changed,$isNew){
if($isNew) { /* Only new users */
$data['alias_of_the_field'] = "value"; /* Assign the value */
}
}
public function triggerProfileUpdate($user,&$data,$changed,$isNew){
if($isNew) { /* Only new users */
$data['alias_of_the_field'] = "value"; /* Assign the value */
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$usergroup = 26; /* Change 26 with the id of the usergroup */
JsnHelper::addUserToGroup($user,$usergroup);
// To remove from usergroup you can use a function like this: JsnHelper::removeUserFromGroup($user,$usergroup);
}
}
defined('_JEXEC') or die;
class PlgJsnSkeleton extends JPlugin
public function triggerProfileUpdate($user, &$data, $changed, $isNew)
{
if ($isNew) { /* Only new users */
$data['preferred_contact_method'] = "E-mail"; /* Assign the value */
$data['newsletter_type'] = "General"; /* Assign the value */
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$usergroup = 17; /* Change 26 with the id of the usergroup */
JsnHelper::addUserToGroup($user,$usergroup);
// To remove from usergroup you can use a function like this: JsnHelper::removeUserFromGroup($user,$usergroup);
}
}
?>