Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

login

Problem with logging in WP users automatically

In the end, wp_signon() was the solution, as the cookie was apparently not set with the code I was using. I followed this solution https://gist.github.com/iandunn/8162246 to circumvent a need for password and added these functions to functions.php. I also moved the autologin code from ‘init’ to template where it executes before any headers are sent … Read more

Categories login Tags login, password, user-registration

Remove username in emails or swap username for email

I think you just need to take the md5() out of this line: $result[‘user_name’] = md5($result[‘user_email’]); I’m not that familiar with buddy press but if empty($result[‘errors’]->errors[‘user_email’]) being true means a user was succesfully registered I’d use something like wp_update_user( array( ‘ID’ => $user_id, ‘name’ => $result[‘user_email’] ) );

Categories PHP Tags buddypress, login, php, user-registration

How to implement Google reCaptcha without installing a plugin?

you can use this function i think it works properly. add_filter( ‘wp_authenticate_user’, ‘verify_recaptcha_on_login’, 10, 3 ); function verify_recaptcha_on_login($user, $password) { $secretkey = “your secret key”; if (isset($_POST[‘g-recaptcha-response’])) { $response = wp_remote_get( ‘https://www.google.com/recaptcha/api/siteverify?secret=”.$secretkey.”&response=” . $_POST[“g-recaptcha-response’] ); $response = json_decode($response[‘body’], true); if (true == $response[‘success’]) { return $user; } else { // FIXME: This one fires if … Read more

Categories login Tags authentication, captcha, code, google, login

Restrict PDF links

You cannot restrict users from downloading a file from a path using a wordpress login for various reasons, the most important is that the WP login is handled by PHP while the download is handled via Apache. That said, there is a way to achieve the result of what you’re after. What you need to … Read more

Categories login Tags content-restriction, login, pdf

Mobile users redirected to a different page on login unless linked to another post

Try this one- add_filter(‘login_redirect’, function($to, $request, $user) { if ( wp_is_mobile() && $request == null ) { return home_url().’/mobile-news’; } return $to; }, PHP_INT_MAX, 3); Not tested, but should work. Note: using a URL like this one home_url().’/mobile-news’ is not a good idea, I think. Use get_permalink( $post_id ) instead. Where $post_id is the ID … Read more

Categories login Tags login

Can’t login after URL change

Looks like the issue was because of Nginx or other caching server. Rebooting the server solved the issue! There was nothing more to do in the database or wp-config.php

Categories login Tags cookies, login

Cannot log into WordPress Dashboard after removing/adding .htaccess

A good idea might be to get a back up your old htaccess file and see if the issue still occurs. If it does, why not add the code from your existing file to the end of the wordpress file?

Categories wp-admin Tags .htaccess, dashboard, login, wp-admin

Login & Register & Custom details WITHOUT plugin

I am doing the same thing at the moment and I just use the standard WP login/register systems/pages. You can use wp_signon() to do logon. Then on a standard page, you can create a custom template and use this for retrieving their info: wp_get_current_user() You will also need to get the customer user meta information … Read more

Categories custom-field Tags advanced-custom-fields, custom-field, login, user-registration

Making a client page

For the client role, use this; // Add a client user role $result = add_role( ‘client’, __( ‘Client’ ), array( ‘read’ => true, // true allows this capability ‘edit_posts’ => false, // Allows user to edit their own posts ‘edit_pages’ => false, // Allows user to edit pages ‘edit_others_posts’ => false, // Allows user to … Read more

Categories login Tags login

Login cookie across multiple domains on network w/ mapping

WordPress is deciding whether you are logged in or not by checking AUTH_COOKIE and LOGGED_IN_COOKIE. As you have noticed these cookies are set in the same, let,s say, A domain which your site is. Adding the same cookies to your second B domain would make your user logged in in two A and B domains. … Read more

Categories login Tags cookies, domain-mapping, login
Older posts
Newer posts
← Previous Page1 … Page132 Page133 Page134 … Page164 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress