Hey there Sascha,
I’ve not worked on this plugin for some time so apologies that my answer may not be perfect.
As that is a beta feature it may not work, however it may not work well with the empty state.
What I would be more confident would work would be the exlog_hook_filter_custom_should_exclude
hook. Here’s the notes on it from the documentation:
- exlog_hook_filter_custom_should_exclude
This hook allows you to add custom logic to exclude users.
It provides you with all the data for the user that is stored in the external database users table.
If you return
true
(or a string - see below regarding custom error messages) from this function it will prevent the
user logging in, and returning false
will bypass this exclusion.
For example, let's say your external users table had a field called expiry
which stored a date. In this example we
want to block users if they login after their expiry date.
Adding the following to your functions.php
would achieve this:
<br>function myExlogCustomExcluder($userData) {<br>return strtotime($userData['expiry']) < strtotime('now');<br>}<br>add_filter('exlog_hook_filter_custom_should_exclude', 'myExlogCustomExcluder', 10, 1);<br>
Alternatively if you provide a string the user will be blocked and the string will be used as the error for the user.
<br>function myExlogCustomExcluder($userData) {<br>return strtotime($userData['expiry']) < strtotime('now') ? 'Your account has expired' : false;<br>}<br>add_filter('exlog_hook_filter_custom_should_exclude', 'myExlogCustomExcluder', 10, 1);<br>
The below code is what I imagine would work for you but I haven’t done any testing.
function myExlogCustomExcluder($userData) {
return empty($userData['email_verified_at') ? 'Your e-mail has not been verified' : false;
}
add_filter('exlog_hook_filter_custom_should_exclude', 'myExlogCustomExcluder', 10, 1);