2018-11-18, 08:02 AM
(This post was last modified: 2018-11-18, 01:29 PM by gungrave41.)
How to return a false to datahandler:user on a custom plugin
Basically I made a custom hook to ''datahandler_user_validate" that checks if a custom registration field data (exists or been used), namely "Student ID" which is an optional field (can be left blank). But if the guest inputs something and filters falls into false, the plugin should stop "datahandler_user_insert" from querying the INSERT_USER and instead return an error / return false.
any help is appreciated...
Oh. what a bummer, I actually solved my problem by using arguments
$args = $plugins->add_hook("datahandler_user_validate", "db_override");
function db_override($args)
{
$args->set_error($reply);
return false;
}
Fixes my day....
Basically I made a custom hook to ''datahandler_user_validate" that checks if a custom registration field data (exists or been used), namely "Student ID" which is an optional field (can be left blank). But if the guest inputs something and filters falls into false, the plugin should stop "datahandler_user_insert" from querying the INSERT_USER and instead return an error / return false.
any help is appreciated...
Oh. what a bummer, I actually solved my problem by using arguments
$args = $plugins->add_hook("datahandler_user_validate", "db_override");
function db_override($args)
{
$args->set_error($reply);
return false;
}
Fixes my day....