Closed JuhG closed 7 years ago
Good one, thanks!
Initially I left the $user
parameter required, because I thought that it would be a good idea to force developers check whether there is a logged-in user or not. Looking at it now, I realize that this wouldn't help anyway, because it's too easy to
$user = rila_user( wp_get_current_user() );
instead of
if( is_user_logged_in() ) {
$user = rila_user( wp_get_current_user() );
}
Even though the parameter in the first example is provided, if there is no logged in user, the same Missing_Object_Exception
will be raised. Now you can just do this and I like it:
if( is_user_logged_in() ) {
$user = rila_user();
}
It defaults to current user, so I believe this was the intended behaviour.