my_login_redirect won't get_user_meta
-
Users log in with the WP-members plugin widget. The normal login_redirect wasn’t triggered, the wpmem_login_redirect is.
After login I get the users language preference from their profile (it’s a custom wpmem field) and I want to redirect them to the page in their language.
$user_ID writes “0” and $language writes nothing. What am I doing wrong?
I also set up a redirect_after_profile_update and that works as expected, same variables…
I put the php code in the plugin ‘Shortcodes, Actions ad Filters’.function my_login_redirect( $url, $request, $user ){ $user_ID = get_current_user_id(); $language = get_user_meta(intval($user_ID), 'KitLanguage', 1); file_put_contents ( 'C:\logfile.txt', 'user_ID: '.$user_ID.' $language: '.$language ); } add_filter( 'wpmem_login_redirect', 'my_login_redirect', 10, 2 );
Any help would be appreciated…!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘my_login_redirect won't get_user_meta’ is closed to new replies.