desireeM
Background of the issue:
WPML 4.6.13
sitepress-multilingual-cmsclassesrequest-handlingclass-wpml-language-per-domain-sso.php
You have this code:
`if ( ! apply_filters( 'send_auth_cookies', true ) ) {`
But in wp-includes/pluggable.php there is:
`if ( ! apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) ) {`
If any plugin add_filter on "send_auth_cookies" hook, e.g.
```
add_filter( 'send_auth_cookies', 'are_cookies_allowed', 10, 4 );
function are_cookies_allowed( $filterable, $expire, $expiration, $user_id ) {
```
The site doesn't work and you get a fatal error. You need to pass all args like WP core when re-using WP core hooks in your plugin.
Symptoms:
Fatal error because WPML send_auth_cookies filter has too few arguments. The site doesn't work and you get a fatal error.
Questions:
Fix this
Bruno Kos
Supporter
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+01:00)
Hi,
Thank you for contacting WPML support!
So this happens when you use domain per language only? Can you send me a full error message with a call stack?
Regards,
Bruno Kos
desireeM
In PHP 7.4+ (including 8+) we get:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function my_callback(), 1 passed in ....php on line x and exactly 4 expected in ...
We get this whenever this class is loaded - it seems only if language per domain SSO is used from the class name.
Bruno Kos
Supporter
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+01:00)
This is escalated to WPML developers team.
I will keep this thread updated, but possibly the solution will be that we use
if ( ! apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) ) {
return;
}
in our code.
desireeM
Exactly that's the solution