There is /wordpress/wp-admin or /wp-admin and the one I use a lot is
/admin (it’s this I give out to clients as it’s so user-friendly)
neither of which pass the query string.
If I understand what you’re getting at, I think what you’re looking for is how the wp_redirect_admin_locations()
function is used.
This is a canonical function that defines the admin locations and handles the redirects based on the requested URLs.
WP applies this function hooked to template_redirect
, with a priority of 1000. That means anyone who just applies a revised version of this an uses the default priority for an action hook (10), the custom version will kick in and redirect the user. Simply put – you can write your own version of it and handle passing any necessary query strings.
// WP's default
add_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
// At default priority, your custom version will kick in before WP's.
add_action( 'template_redirect', 'my_custom_redirect_admin_locations' );
(Note: I left out any specific of writing a custom version of the wp_redirect_admin_locations()
function as it seems you probably have a handle on how to do that already. Also, I would suggest that there be some leeway in any custom handling to allow execution to continue and the default to ultimately be hit if there is no custom case applied.)