Osclass forums
Development => Development => Topic started by: Xefiron on May 07, 2019, 01:23:36 am
-
For example, within UserActions.php are these two error messages, which are then stored in an array:
$flash_error .= sprintf(_m('The specified e-mail is already used by %s') , $user_email['s_username']) . PHP_EOL;
$error[] = 3;
$flash_error .= _m('The name cannot be empty').PHP_EOL;
$error[] = 10;
Is there a list of errors to follow in order to implement error messages?
-
You can simply use the filter available for errors
function user_register_error($flash_error){
$my_field = Params::getParam('my_field');
if($my_field !='some_value'){
$flash_error .= __('Error', 'my_theme') . PHP_EOL;
}
return $flash_error;
}
osc_add_filter('user_add_flash_error', 'user_register_error');