grahasdsiweb
Forum Replies Created
-
Hi @rsouzaam
Thanks for replying.Firstly, I don’t try to customizations?the wpform but when I leave my browser for awhile and then come to access the page, the error above seems to appear. Is there any problem cause of reloading the page?
Forum: Developing with WordPress
In reply to: Custom Auto Login FormWould you mind to shared the code you’ve tried? I still can’t fully grasp on the init hook.
Forum: Developing with WordPress
In reply to: Custom Auto Login FormI’ve tried to just hard code the email below and it’s worked. Got the printf current user too.
But another problem is when I’ve tried to open the website url in another tab in the same window, it’s still not count as logged in with the user before.
$email = '[email protected]'; $user = get_user_by('email', $email); $password = '012345678'; if ($user != null) { $result = json_decode(json_encode($user), true); $creds = array(); $creds['user_login'] = $email; $creds['user_password'] = $password; $creds['remember'] = false; $login = wp_signon($creds, false); if ($login) { if (!is_wp_error($login)) { wp_set_current_user($result["data"]["ID"], $result["data"]["user_login"]); do_action('wp_login', $result["data"]["user_login"], $login); $current_user = wp_get_current_user(); printf(__('Username: %s', 'textdomain'), esc_html($current_user->user_login)) . '<br />'; } else { echo "Invalid login credentials."; } } else { echo 'Not login'; } }
Forum: Developing with WordPress
In reply to: Custom Auto Login FormHi @bcworkz
Thanks for replying.
I’ve tried the code below. It got the text “Right here” but still not logged in. Would you like to check if there is something wrong in my code?$user = get_user_by('email', $_POST['login-email']); $password = '01234567'; if ($user != null) { $result = json_decode(json_encode($user), true); $creds = array(); $creds['user_login'] = $result["data"]["user_login"]; $creds['user_password'] = $password; $creds['remember'] = false; $login = wp_signon($creds, false); if ($login) { if (!is_wp_error($login)) { wp_set_current_user($result["data"]["ID"], $result["data"]["user_login"]); wp_set_auth_cookie($result["data"]["ID"]); do_action('wp_login', $result["data"]["user_login"], $login); echo "Right here"; } else { echo "Invalid login credentials."; } } else { echo 'Not login'; }
Thnak you for the reminder.
Hi @sazdhossain
Thanks for replying. Already try those step and working just fine.
I have another question, is there a way to modify (or just edit the label) shipment field right here? Cause I couldn’t find after searching it in the dokan-lite code to find this field.Hi @niksebastian
Thanks for replyingIs it possible to store the content of the input field in the form to a new database table after the user submitted the form?
Thank you for replying.
If I haven’t updated dokan to the latest version, did it will cause some issue like that?PS. I’ve tried deactivate the plugins except dokan & woocommerce, if I want to try the next method, do I have to activate the other plugins back?
- This reply was modified 2 years, 9 months ago by grahasdsiweb.