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

How do we check if the user is logging in or registering?

I think your best bet is to check if the action parameter is set & equal to register: if ( isset( $_REQUEST[‘action’] ) && $_REQUEST[‘action’] == ‘register’ ) add_filter( ‘login_message’, ‘filter_register_text’ );

Categories filters Tags filters, login

Using /wp-admin works, using /login gives a 404. Why?

/wp-admin/ is an existing directory, your server just adds the missing /. /login is … nothing. The correct name is /wp-login.php. If you have enabled permalinks it should work though. To make /login always work add the following line to your .htaccess above the WordPress rules: Redirect Permanent /login /wp-login.php You can and should localize … Read more

Categories wp-admin Tags 404-error, login, wp-admin, wp-login-form

How to get login data (session) outside WordPress?

I solved my problem, and it could definitely help others too. The problem was with cookies since my folder structure was like this : mysite.com mysite.com/mypage.php mysite/wordpress/ the cookies were only valid for wordpress folder, and it’s subdirectories. In order to activate the cookies outside wordpress, I installed the root Cookie plugin, and everything works … Read more

Categories login Tags cookies, login, session, wp-login-form

How to create a word press user with hashedpassword

You would have to update the password column in the database (see below). But this alone won’t work. Password hashes are salted using the SALT keys in your wp-config.php (this must be kept secret). Your new site would need to have identical keys for the password verification to work. The following function updates a given … Read more

Categories plugins Tags login, password, plugins

Constructing a custom login form using ajax

Thanks to @eskimo I was able to get this working and figured I share an answer for any of those trying to do the same! In the ajax-login-script.js file all I had to do was change this $(‘form#login_form’).on(‘#submit’, function(e) to this … $(‘form#login_form’).on(‘submit’, function(e) just removing the # before calling submit. Hope this helps someone!

Categories PHP Tags ajax, login, php

Customize user account activation message

I’ve found the answer here: Customizing wp-activate.php It’s a bit of a workaround really, but it works pretty well. Step 1 Create a new page called ‘activate’ Step 2 Create a new template called ‘template-activate.php’ and add the following code: **Template (template-activate.php)** <?php /** * Template Name: Activation * */ /** * Confirms that the … Read more

Categories filters Tags activation, filters, hooks, login

How does WordPress track that a certain User is Logged-In

Before core version 4.0 the authentication depended only on cookies. Starting with 4.0 core introduced its own sessions (WP_Session_Tokens) to better handle security things. Note that these are not PHP sessions, they are implemented purely by WordPress and use user meta as storage. Unfortunately I don’t think there is any clear documentation for this feature. … Read more

Categories login Tags login, post-status

User logon by using mobile number [closed]

First of all get user by Phone no. $user = reset( get_users( array( ‘meta_key’ => ‘PHONE_META_KEY_HERE’, ‘meta_value’ => $USER_PHONE_NO_HERE, ‘number’ => 1, ‘count_total’ => false ) ) ); Now check if Password matches with the user we retrived by phone. if($user){ if(wp_check_password($USER_PASSWORD_HERE, $user->user_pass, $user->ID)){ // Success. User login credentials matched. Login user with `wp_set_auth_cookie`. wp_clear_auth_cookie(); … Read more

Categories login Tags login

Check for user meta data at Login

If you use the filter wp_authenticate_user you get the user object you need to use the user ID to get the user meta function isUserActivated($user){ $userStatus = get_user_meta($user->ID, ‘account_activated’, true); // for testing $userStatus = 1; $login_page = home_url(‘/login/’); if($userStatus == 0){ wp_redirect($login_page . “?login=failed”); exit; } return $user; } add_filter(‘wp_authenticate_user’, ‘isUserActivated’); But I think … Read more

Categories users Tags login, user-meta, users

wordpress custom login successful redirect hook

wp_login_form() has the “redirect” parameter. Define it on the basis of user role. http://codex.wordpress.org/Function_Reference/wp_login_form

Categories plugins Tags functions, login, plugins, redirect, user-roles
Older posts
Newer posts
← Previous Page1 … Page135 Page136 Page137 … 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