php - using wp_authenticate() to redirect certain users when logging in -
our website using wordpress - woocommerce login page customers login. i trying use wp_authenticate() achieve following: 1) customer login our new website, enter username , password, , hit login button. in case want see woocommerce login file, click here . 2) our new website goes through list see if username matches. if username matches, don't @ password, redirect user other url such google.com 3) if username doesn't match our list, let them login usual. with jquery, helped me come following code: var names = new array(”bill”, ”jim”, ”bob”); // names array, , in uppercase var dest_url = ”http://www.website.com”; // url want send them jquery(document).ready(function () { jquery(”input[name=’login’]”).click(function(event){ event.preventdefault(); // prevent default form action var current_name = jquery(”#username”).val(); current_name = current_name.trim().touppercase(); if ( -1 != jquery.inarray(current_name, names) ) { alert(”redirecting ” + current_name + ” ”