Jump to content

cyberpods

Retired Forum Member
  • Posts

    2
  • Joined

  • Last visited

Everything posted by cyberpods

  1. Ok, I figured it out. I decided to use the internal API to make the changes. Here is the code I'm using if it can help anyone else. add_hook( 'ClientAdd', 1, function($vars) { $userid = $vars['userid']; $command = "updateclient"; $adminuser = "adminuser"; $values["clientid"] = $userid; $values["customfields"] = base64_encode(serialize(array("1"=>"CustomValueStringToSave"))); $results = localAPI($command,$values,$adminuser); return array(); } );
  2. Hi all, I'm trying to add a custom field to a clients account when their account is created and cant't seem to get it working. This code works when I save any field on a clients account that's already created. add_hook( 'CustomFieldSave', 1, function($vars) { //Check that the fieldid is one you wish to override if ($vars['fieldid'] == 1 && strlen($vars['value']) == '0') { return array('value' => "MyCustomField"); } return array(); } ); But this does not work. add_hook( 'ClientAdd', 1, function($vars) { //Check that the fieldid is one you wish to override if ($vars['fieldid'] == 1 && strlen($vars['value']) == '0') { return array('value' => "MyCustomField"); } return array(); } ); What am I doing wrong?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated