I've followed the documentation from WordPress, but my functions.php file still is not getting the token (abcd) variable from the URL: https://example.com/reset-password/?token=abcd
My functions.php file includes the following:
function add_query_vars_filter( $vars ) {
$vars[] = "token";
return $vars;
}
add_filter( 'query_vars', 'add_query_vars_filter' );
...
add_filter( 'wpcf7_validate_text*', 'custom_password_reset_validation_filter', 10, 2 );
function custom_password_reset_validation_filter( $result, $tag ) {
// Make POST request to change password
$token = get_query_var( 'token', "fk" );
write_log("TKN: {$token}");
}
return $result;
}
For some reason, get__query_var always returns fk instead of abcd.
GETparameter in myContact Form 7validation?