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

Why does is_user_logged_in() return false after redirect from another site?

Where are you triggering the second code block (that includes is_user_logged_in())? That code may be triggered before set_current_user, which is called after plugins_loaded. I would take a look at the action reference and see if you are calling your check before WordPress is aware of the user.

Categories users Tags login, users

WordPress AJAX Login Screen

My recommendation would be to use a plug-in like Lightbox Plus to power your link. Clicking the link would load your standard login form inside a lightbox. You could then automatically redirect to the same page so that, once logged in, users can leave a comment. Basically, you’d dynamically build your link to be something … Read more

Categories ajax Tags ajax, front-end, login, wp-login-form

Unable to login to new custom domain on multisite?

Found the answer. I had not ran the Domain Mapping plugin before switching it to a custom domain. So the correct steps should look like this: Create new site as a sub-domain (site.example.com) Point sub-domain at root (example.com) Point custom domain (site.com) at root (example.com) Visit admin page for sub-domain (site.example.com) Add custom domain (site.com) … Read more

Categories multisite Tags login, multisite

Stop users from logging in from multiple locations

We had a similar problem where we needed to give access to partners and “membership” or “subscription” plugins seemed to offer what we needed. The problem we had was that the plugins we found were all for-pay, not free or freemium. Understanding this, the MagicMembers and aMember Pro plugins both had functions that could prevent … Read more

Categories login Tags limit, login, membership

How to get Login Error messages on a custom template

One way you could get the error message to your custom login page would be to use wp_login_failed hook. It could look something like this: add_action( ‘wp_login_failed’, ‘my_login_fail’ ); // hook failed login function my_login_fail( $username ) { //redirect to custom login page and append login error flag wp_redirect(home_url( ‘?page_id=4’ ) . “&login_error” ); exit; … Read more

Categories plugins Tags errors, login, plugin-development, plugins

Log in from one wordpress website to another wordpress website

You can not set cookies form site A that will be applicable on site B, therefor your “login by proxy” scheme will not work, and can not be made to work. In addition storing passwords in plain text is just a big no-no.

Categories plugin-development Tags authentication, login, plugin-development, security, wp-remote-post

Integrate recaptcha and wp_signon – what is needed?

So Wordfence uses JavaScript to add the CAPTCHA fields to the login/registration form, but by default only on https://example.com/wp-login.php. And if you want to add the fields to your form, or integrate the CAPTCHA security with your custom login form, the steps are: Enqueue the (re)CAPTCHA scripts, preferably only on the page having the custom … Read more

Categories login Tags captcha, errors, login

handling login/logout redirects

This really does belong in a plugin, but you can just as easily drop it in your theme’s functions.php function default_login_redirect( $redirect, $request_redirect ) { if ( $request_redirect === ” ) $redirect = home_url(); return $redirect; } add_filter( ‘login_redirect’, ‘default_login_redirect’, 10, 2 );

Categories redirect Tags login, logout, redirect

Check user logged in with JS

Just use wp_localize_script() and is_user_logged_in(). wp_localize_script( ‘my-ajax-request’, ‘MyAjax’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ), ‘logged_in’ => is_user_logged_in() ) );

Categories javascript Tags javascript, login, regex

Add Confirm Password field in wp-login.php Password Reset page

It’s tempting to unhide the pass2 input but that’s not enough. In the file /wp-admin/js/user-profile.js the bindPass1() binds it to pass1 that makes writing to it not possible. The pass2 input is then hidden in bindPasswordForm() with $(‘.user-pass2-wrap’).hide(); We can instead add our own input field to validate the password. First we add it via … Read more

Categories login Tags login, password
Older posts
Newer posts
← Previous Page1 … Page151 Page152 Page153 … 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