Front end register with custom fields

With the help of something @TurtleTread said, I managed to get it working. My code was fine except had to change two things. I removed the custom field from my $user_data, and added this after right after wp_insert_user — add_user_meta($user_id, ‘broker_email’, $b_email); Here’s my final code in my functions.php file — add_action(‘template_redirect’, ‘register_a_user’); function register_a_user(){ … Read more

register_post_type permalink

You have to use post_type_link filter. Create a handler to handle this filter, you can create $permalink as per your need there. In addition to this, you may have to use “pre_get_posts” action also. I used both these couple of months ago, I created permalinks to show as cpt_name/post_name.

Custom registration and pending approval

Ok, I found a way to do it. It’s not a perfect solution but will allow me to continue the project. I just created another role called ‘shop_pending’. When the user registers as a shop, he won’t get the role ‘shop’, instead he will get the role’ shop_pending’. After all the process is done, the … Read more

Block Disposable Emails on Woocommerce Registration

Hi just add this code in your theme functions.php add_action(‘init’, ‘mydomain_plugin_checks’); function mydomain_plugin_checks(){ if ( class_exists(‘BanHammer’) ) { add_filter(‘woocommerce_registration_errors’, ‘woocommerce_banhammer_validation’, 10, 3 ); } } function woocommerce_banhammer_validation( $validation_errors, $username, $email ) { if( (new BanHammer)->banhammer_drop( $username, $email, $validation_errors ) ) return new WP_Error( ‘registration-error-bad-email’, (new BanHammer)->options[‘message’] ); return $validation_errors; }

How to programmatically read the plan text password when user register?

There is an action https://developer.wordpress.org/reference/hooks/check_passwords/ which can be used to add your checking code. You could save your ‘strength indicator’ by adding it to $_POST and then re-accessing it when the user data is saved. Actions for that are https://codex.wordpress.org/Plugin_API/Action_Reference/user_register and https://codex.wordpress.org/Plugin_API/Action_Reference/profile_update. These actions are listed on https://codex.wordpress.org/Plugin_API/Action_Reference. Alternatively when looking for an action or … Read more

Disable password limitations

if you use wocommerce please try this code to your current theme functions.php add_action( ‘wp_enqueue_scripts’, ‘misha_deactivate_pass_strength_meter’, 10 ); function misha_deactivate_pass_strength_meter() { wp_dequeue_script( ‘wc-password-strength-meter’ ); }

Force display name to nickname wp

Hi Guys in response to further details on my answer, so basically i searched for plugin solutions in preference to adding code (i am not a developer) and found a plugin that does the job very well called change display name publicly as. Hope this feedback is relevant and helpful. many thanks, J