Custom registration form page/template

You can also take a look on Profile Builder Plugin, that allows you to customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user profile or register new users (front-end user registration). You can add custom fields to your registration form and customize … Read more

Delete a specific category when deleting a user

delete_user action involves two parameters: $id and $reassign. So you should specify two parameters for the hook. Because sanitize_term() and sanitize_user() use different ways to sanitize strings, ‘tips_’ . $_POST[‘user_login’] and ‘tips_’ . $user_obj->user_login are not always the same string. So it’s better to use ‘tips_’ . sanitize_user($_POST[‘user_login’) as term name when inserting the term.

Integrating WordPress to my website, while keeping my own authentication system

WordPress’s authentication system is made up of pluggable functions, which means that you can write a plugin that has a function named, say, wp_authenticate(), and your site will use your wp_authenticate() function instead of the native WordPress one. Your comment about is_user_logged_in() (on your original post) is obviated by the fact that is_user_logged_in() calls the … Read more

How can i force Display names to be the same as Usernames?

You can use the wp_pre_insert_user_data filter. function wpse_filter_user_data( $data, $update, $id) { if( isset( $data[ ‘user_login’ ] ) ) { $data[ ‘display_name’ ] = $data[ ‘user_login’ ]; return $data; } $user = get_user_by( ’email’, $data[ ‘user_email’ ] ); $data[ ‘display_name’ ] = $user->user_login; return $data; } add_filter( ‘wp_pre_insert_user_data’, ‘wpse_filter_user_data’, 10, 3 ); You’ll probably want … Read more

Why do generated passwords start/end with spaces?

If wp_generate_password() was called with the third parameter $extra_special_chars = true a space might be part of the password: function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) { $chars=”abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789″; if ( $special_chars ) $chars .= ‘!@#$%^&*()’; if ( $extra_special_chars ) $chars .= ‘-_ []{}<>~`+=,.;:/?|’; $password = ”; for ( $i = … Read more

Save custom user meta on registration

You have to trigger the following hooks: user_register personal_options_update edit_user_profile_update add_action(‘user_register’, ‘addMyCustomMeta’); add_action(‘personal_options_update’, ‘addMyCustomMeta’ ); add_action(‘edit_user_profile_update’,’addMyCustomMeta’ ); function addMyCustomMeta( $user_id ) { update_user_meta( $user_id, ‘user_phone’, $_POST[‘user_phone’] ); } Hope that helps!!

turn off new user registration emails

Generic Pluggable Approach for WordPress < 4.6 (See @birgire’s Answer for > 4.6) Pluggable functions are one of the more depressing relics of WordPress’s past and come with a slew of intricacies. That directly modifying the core file (which is entirely inadvisable, as @Jarmerson mentioned in the comments) did not work makes me suspect that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)