Custom user creation and auto login problem
I have similar functionality on one of my app. I used wp_set_auth_cookie(). Remove the custom_login() function and use wp_set_auth_cookie($user_id) in its place.
I have similar functionality on one of my app. I used wp_set_auth_cookie(). Remove the custom_login() function and use wp_set_auth_cookie($user_id) in its place.
Because you need to give your function a parameter: function auto_follow_admin( $user_id ) { // Now you can use $user_id, which is passed to the function from the hook caller }
No need for the two functions/hooks – just use the first, with the addition of: if ( $post_id = wp_insert_post( $user_page ) ) { wp_update_post( array( ‘ID’ => $post_id, ‘post_name’ => $post_id, ) ); }
Wrap the registration shortcote output with your own callable function and return a str_replace modified output.
Sounds like you want a WordPress Multisite installation with a wildcard subdomain configuration.
Check out the documentation for the get_user_by() function – ‘user_firstname’ and ‘user_lastname’ aren’t properties of the returned object. This is because this data is not a part of the user model – rather they are stored in user metadata. You should be able to use the get_userdata() function, as it returns an object containing both … Read more
You might have missed the right configuration in your hosts file. Assuming you are using Apache on a Linux server and vi editor, open this file: sudo vi /etc/apache2/sites-available/example.com.conf Since you have installed Multsite as subdomains, adjust your directives to include these: Listen 80 <VirtualHost *:80> DocumentRoot “/var/www/example” ServerName example.com ServerAlias *.example.com </VirtualHost> Note that … Read more
WordPress not sending registration mail? (works on ‘lost password’)
You must use enctype=”multipart/form-data” in the <form> tag for the file upload to work.
I found that I was setting the default mime type for wp_mail_content_type to be text/html which according to the notes on the codex can cause this particular issue. I’ve removed the code from my functions file, and the registration email looks better, but (and I haven’t seen WordPress’s emails in a long time) still doesn’t … Read more