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

Multisite – Redirect All Users to Subsite Home Page on Subsite Login

Try something like this: add_action( ‘wp_login’,’redirect_to_homepage’); function redirect_to_homepage() { // if user is accessing admin page/dashboard do not redirect if (is_admin()) { return; } wp_redirect( get_home_url()); exit; } Edited to add optional line that does not redirect if user is accessing the Dashboard.

Categories multisite Tags login, multisite, redirect

wp_login action hook not working

You’re probably running into a problem with $current_user->id being deprecated since WordPress 2.1. Specifically, I get this notice in the error log: Notice: WP_User->id was called with an argument that is deprecated since version 2.1! Use WP_User->ID instead. in /xxx/xxx/public_html/wordpress/wp-includes/functions.php on line 2923. Use $current_user->ID instead. Or you may be able to use get_current_user_id(): add_action( … Read more

Categories login Tags actions, login, publish

Websites defaced by uploading script using theme editor

Now what baffles me is according to logs they all them seem to have logged-in directly to WordPress as if they know the password (since it’s only one login attempt in line 16 above). This is true even for sites only up one day ago and the passwords are not simple ABCs. It is also … Read more

Categories login Tags hacked, login, security

Remove built in wordpress login and use only google auth

To remove WP native username/password authentication use the code below. It can be added to the theme (functions.php), to a plugin, or mu-plugin. Just make sure you have another authentication module working before you disable WP native auth. remove_filter(‘authenticate’, ‘wp_authenticate_username_password’, 20, 3);

Categories login Tags login, wp-login-form

setting a specific home page for logged in users

About your considerations:- Yes true! It will update the page on every visit. The database will be updated more frequently based on which user making a request. But there will be no incorrect output. The better way I suggest using a template_include filter. Assign a static front page then apply the template to that page … Read more

Categories customization Tags content-restriction, customization, homepage, login

Get user info outside WordPress

Very similar to this question of a couple of hours ago: How can I get a list of latest posts outside of my WP install? Use chdir() to move into WordPress root before including and even calling anything related to WordPress. The are cases where relative directory and file references are used, thus breaking many … Read more

Categories users Tags login, user-registration, users

WordPress Login Footer URL

Since this is not a standard feature you could achieve this with your own css and js you could add to the page like this <?php function custom_login() { echo ‘<link rel=”stylesheet” type=”text/css” href=”‘.get_bloginfo(‘template_directory’).’/custom-login/custom-login.css” />’; echo ‘<script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js”></script>’ echo ‘<script type=”text/javascript” src=”‘. get_bloginfo(“template_url”) . ‘/js/yourScript.js”></script>’; } add_action(‘login_head’, ‘custom_login’); ?> change jquery url as wanted to … Read more

Categories login Tags login, wp-login-form

How to move wp-admin login page to another location? [closed]

You can disable the wp-login page from your functions by hooking into login_head: add_action( ‘login_head’, ‘wp_die’); (that’s obviously a very clumsy way of doing it, but it prevents anyone from being able to login through that page. You could make that a redirect function, or a warning message, rather than just a die.) And copy … Read more

Categories wp-admin Tags login, wp-admin

What hooks should I use for pre-login and pre-registration actions?

Proper hooks for login and register actions: <?php function custom_plugin_hooks() { add_action( ‘login_form’, ‘custom_plugin_form_inputs’ ); add_filter( ‘authenticate’, ‘custom_plugin_login_check’, 100, 3 ); add_action( ‘register_form’, ‘custom_plugin_form_inputs’ ); add_action( ‘register_post’, ‘custom_plugin_registration_check’, 100, 3); } custom_plugin_hooks(); function custom_plugin_form_inputs() { echo “\n”.'<p>’; echo ‘<label>Custom input: <br />’; echo ‘<input type=”text” name=”custom-input” class=”input” value=”” />’; echo ‘</label></p>’.”\n”; } function custom_plugin_login_check($user, $username, … Read more

Categories login Tags login, user-registration

Redirect users after first login

Use following code to achieve your requirement. //hook when user registers add_action( ‘user_register’, ‘myplugin_registration_save’, 10, 1 ); function myplugin_registration_save( $user_id ) { // insert meta that user not logged in first time update_user_meta($user_id, ‘prefix_first_login’, ‘1’); } // hook when user logs in add_action(‘wp_login’, ‘your_function’, 10, 2); function your_function($user_login, $user) { $user_id = $user->ID; // getting … Read more

Categories redirect Tags front-end, login, redirect
Older posts
Newer posts
← Previous Page1 … Page143 Page144 Page145 … 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