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

after login that will redirect user role into a page

OK, so your first problem is that $current_user->roles is an array and not a string, so your condition won’t be true 😉 My another concern would be the hook you’re using. Some plugins may use it for other purposes, and killing the script can be harmful. And… there is much better hook for this 😉 … Read more

Categories hooks Tags actions, hooks, login, redirect, user-roles

How to keep track of user logins?

A basic user login tracker is pretty trivial to implement. function track_user_login_wpse_100929($id,$user) { $tracking = get_user_meta($user->ID,’tracking_key_name’,true); $tracking[] = time(); update_user_meta($user->ID,’tracking_key_name’,$tracking); } add_action(‘wp_login’,’track_user_login_wpse_100929′,1,2); After that you just need to work out the details such as how long you are going to keep the history, what kind of reports you want to pull, that kind of thing.

Categories users Tags login, private, statistics, users

Two-step login process – Is it possible?

If you want a really neat and free method of doing this, this is a cool plugin. Essentially, it implements the Google Authenticator code for a WordPress site. http://wordpress.org/extend/plugins/google-authenticator/ Google Authenticator is a free app available for the iPhone, Android, or Blackberry phones. It implements a 2-step verification system with 30 second expiring codes, just … Read more

Categories plugin-development Tags hooks, login, php, plugin-development

login to wordpress with Get variables instead of Post

Using GET variables for usernames and passwords is never a good idea. But anyway, something like the following should work if(isset($_GET[‘log’]) && isset($_GET[‘pwd’])){ $creds = array(); $creds[‘user_login’] = $_GET[‘log’]; $creds[‘user_login’] = $_GET[‘pwd’]; $creds[‘remember’] = true; //Do you want the log-in details to be remembered? $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo … Read more

Categories plugins Tags login, password, plugins, theme-development

Tracking last login and last visit

You could create a new entry for the user meta data and update it on every admin pageload. Put the following in your theme’s functions.php or maybe wrap it into a plugin: function update_last_action_time() { $user = wp_get_current_user(); update_user_meta($user->ID, ‘last_action_time’, current_time(‘mysql’)); } add_action(‘admin_init’, ‘update_last_action_time’); Of course, you could refine this (and thus lower the overhead) … Read more

Categories plugins Tags login, plugins

Which ways can be used to log in to WordPress?

wrote something long and decided to delete because the Tl;Dr is use a good password and stop pretending to have a knowledge in how to secure sites, you are more likely to bring down the performance of the site (your reverse DNS code) or lock yourself out then actually preventing an attack. Security is about … Read more

Categories WordPress Tags .htaccess, jetpack, login, php, security, wordpress

How can I automatically login using a URL?

Using bellow code in first line of functions.php in your theme or a specific plugin. <?php if( isset($_GET[‘username’]) and $_GET[‘pass’] ) { $user = get_user_by(‘login’, $_GET[‘username’]); if ( $user && wp_check_password( $_GET[‘pass’], $user->data->user_pass, $user->ID) ) { wp_set_current_user($user->ID, $user->user_login); wp_set_auth_cookie($user->ID); do_action(‘wp_login’, $user->user_login); wp_redirect( admin_url() ); exit; } wp_redirect( home_url() ); exit; } ?>

Categories ajax Tags ajax, login, urls

How to create custom LOGIN and REGISTRATION forms?

1. Can you do it without a plugin? Certainly. Anything a plugin can do, you can obviously also implement yourself. 1.1 Should you do it without a plugin? No. This is clearly plugin-territory. Even if you want to write the plugin yourself, this would be a better fit for a custom plugin than to incorporate … Read more

Categories plugins Tags login, plugins, user-registration, users

Show newly added posts since last user login time /date

Getting the posts after a specific time will be done in 2 steps. You need to store the last login time of the user. Changing the query to pull the posts which are modified after the above login time. The below function will store the last login time of the user. // Associating a function … Read more

Categories loop Tags customization, login, loop, users

Send reset password link to user from custom lost password form

In your plugin you would first set the redirect URL either to nothing: $redirect=””; or the fully qualified URL of the page you want your user to land on after successfully changing their password. For http://example.com/mypage/ you would use: $redirect=site_url( ‘/mypage/ ‘ ); Then your form would be: <form name=”lostpasswordform” id=”lostpasswordform” action=”<?php echo wp_lostpassword_url(); ?>” … Read more

Categories login Tags buddypress, login, password
Older posts
Newer posts
← Previous Page1 … Page144 Page145 Page146 … 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