Create users from frontend without password

it’s right here in the codex. This is example code, showing how a new user is created: $user_id = username_exists( $user_name ); if ( !$user_id and email_exists($user_email) == false ) { $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false ); $user_id = wp_create_user( $user_name, $random_password, $user_email ); } else { $random_password = __(‘User already exists. Password inherited.’); } … Read more

New User Registration email

In the admin interface under Settings > General there is a field named E-mail Address. Unless you have a plugin managing your user registration separately, this should be the default email address for registration confirmations.

Is it possible to tell if a user is logged into WordPress from looking at the cookies which are set?

You could use Javascript <script type=”text/javascript”> function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(“;”); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf(“=”)); y=ARRcookies[i].substr(ARRcookies[i].indexOf(“=”)+1); x=x.replace(/^\s+|\s+$/g,””); if (x==c_name) { return unescape(y); } } } var logged_in=getCookie(“wordpress_logged_in_[HASH]”); if (logged_in!=null && logged_in!=””) { alert(“You are logged in!”); } else { alert(“You are logged out!”); } </script> NOTE: WordPress logged in cookie info can be found here. … Read more

Shopping plugin with user groups [closed]

You don’t say if you are setting up a new e-commerce site or a trying to change an existing one. If you are setting up a new site from scratch … then WooCommerce has a premium plugin called Dynamic Pricing which can create different pricing for different types of users.

One folder to be accessible by one user

One solution might be to directly restrict access to the file on the server, but utilize a url rewrite to display the content — only if the id matches in the request. Obviously this doesn’t answer every question in the scenario but it does provide a proof-of-concept to indirectly convert a url into a file. … Read more

Check if username doesn’t exists

Got it fixed. Pretty simple actually. I moved the if part where the user get’s deleted to the bottom of the script. foreach ($data as $gebruiker){ $username = $gebruiker[‘username’]; if ( username_exists( $username ) && $gebruiker[‘status’] == ‘published’ ){ $user = get_user_by( ‘login’, $username); update_user_meta( $user->ID, ‘import_1′, $gebruiker[’email’] ); }else{ $users = wp_insert_user( array( ‘user_login’ … Read more

Change WooCommerce registration form/way?

I’ve been trying out the same code snippet from Cloudways as well. If you don’t use the snippet in functions.php, but instead create a copy of the woocommerce file form-login.php in your child theme’s folder/woocommerce/myaccount. Then the fields from the Couldways snippet can be used before the line containing: <?php do_action( ‘woocommerce_after_checkout_billing_form’, $checkout ); ?>