/** * WordPress Custom Admin Login Slug - Optimized Version * Changes wp-admin/wp-login.php to custom URL */ // Your custom admin slug define('CUSTOM_LOGIN_SLUG', 'mission'); /** * Main function to handle custom login URL */ function custom_admin_init() { $slug = CUSTOM_LOGIN_SLUG; $uri = $_SERVER['REQUEST_URI']; $urlArr=explode("/",explode("?",$uri)[0]); // Handle custom login URL if (in_array($slug,$urlArr) !== false) { require_once ABSPATH . 'wp-login.php'; exit; } // Block default URLs for non-logged users if (!is_user_logged_in()) { if (strpos($uri, '/wp-admin') !== false && strpos($uri, 'admin-ajax.php') === false) { wp_redirect(home_url('/404')); exit; } global $pagenow; if ($pagenow === 'wp-login.php') { wp_redirect(home_url('/404')); exit; } } } add_action('init', 'custom_admin_init'); /** * Replace login URLs throughout WordPress */ function custom_login_url($url, $redirect = '', $force_reauth = false) { $custom_url = home_url('/' . CUSTOM_LOGIN_SLUG . '/'); if ($redirect) $custom_url = add_query_arg('redirect_to', urlencode($redirect), $custom_url); if ($force_reauth) $custom_url = add_query_arg('reauth', '1', $custom_url); return $custom_url; } add_filter('login_url', 'custom_login_url', 10, 3); /** * Replace logout URL */ function custom_logout_url($url, $redirect = '') { $logout_url = home_url('/' . CUSTOM_LOGIN_SLUG . '/?action=logout'); if ($redirect) $logout_url = add_query_arg('redirect_to', urlencode($redirect), $logout_url); return wp_nonce_url($logout_url, 'log-out'); } add_filter('logout_url', 'custom_logout_url', 10, 2); /** * Replace other auth URLs */ add_filter('register_url', function() { return home_url('/' . CUSTOM_LOGIN_SLUG . '/?action=register'); }); add_filter('lostpassword_url', function($url, $redirect = '') { $lost_url = home_url('/' . CUSTOM_LOGIN_SLUG . '/?action=lostpassword'); return $redirect ? add_query_arg('redirect_to', urlencode($redirect), $lost_url) : $lost_url; }, 10, 2); /** * Fix form actions on login page */ function fix_login_form_action() { if (strpos($_SERVER['REQUEST_URI'], '/' . CUSTOM_LOGIN_SLUG) !== false) { echo ''; } } add_action('login_head', 'fix_login_form_action'); Page Not Found - geopulsemedia

Page Not Found

Sorry, but the page you are looking for was moved, removed, renamed, or might never have existed...

Follow
Search
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...