Skip to content

Instantly share code, notes, and snippets.

@rctay
Last active December 21, 2015 00:19
Show Gist options
  • Save rctay/6219624 to your computer and use it in GitHub Desktop.
Save rctay/6219624 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Login, Relaxed
Description: Logins to the admin dashboard are always redirected to `siteurl` by default. This plugin relaxes this to allow logins from URLs apart from `siteurl`. This is useful if you are logging in to WordPress from localhost.
Plugin URI: https://gist.github.com/rctay/6219624
Version: 0.1
Author: Tay Ray Chuan
*/
function wp_login_loginform_action_blank($url, $path, $orig_scheme=null)
{
if ($path !== 'wp-login.php' || $orig_scheme !== 'login_post')
return $url;
return '';
}
add_filter('site_url', 'wp_login_loginform_action_blank', 10, 3);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment