[question]Call back in custom user Field

DroidHost

Well-known member
Call back in custom user Field
can any body give me an Example for using such a feature because I cannot understand it
 
I don't see it documented anywhere. It really should be. But I figured it out.

An example is attached. Once you have uploaded the files then you need to specify the callback for your profile field:

Screen shot 2012-01-12 at 10.51.04 PM.webp

Then edit the code:

library/Callback/UserField.php

It has a basic skeleton you can use to validate the value of a profile field:

Code:
<?php

class Callback_UserField
{
	public static function validate($field, &$value, &$error)
	{
		if ($value == '123')
		{
			return true;
		}
		else
		{
			$error = 'what no';
			return false;
		}
	}
}
 

Attachments

Top Bottom