public function accessUrlAccessManagement($slug)
    {
        if (empty($slug) || 'wp-login.php' === $slug) {
            return;
        }

        // Change login URL
        add_filter('login_redirect', function () use ($slug) {
            return site_url().$slug;
        });

        // Customize Site URL
        add_filter('site_url', function ($url) use ($slug) {
            return str_replace('wp-login.php', $slug, $url);
        }, 10, 3);

        // Make the redirection works properly
        add_filter('wp_redirect', function ($url) use ($slug) {
            return str_replace('wp-login.php', $slug, $url);
        }, 10, 2);
    }
public function accessUrlAccessManagement($slug)
    {
        if (empty($slug) || 'wp-login.php' === $slug) {
            return;
        }

        // Change login URL
        add_filter('login_redirect', function () use ($slug) {
            return site_url().$slug;
        });

        // Customize Site URL
        add_filter('site_url', function ($url) use ($slug) {
            return str_replace('wp-login.php', $slug, $url);
        }, 10, 3);

        // Make the redirection works properly
        add_filter('wp_redirect', function ($url) use ($slug) {
            return str_replace('wp-login.php', $slug, $url);
        }, 10, 2);
    }
public function accessUrlAccessManagement ( $ slug ) { if ( empty ( $ slug ) || 'wp-login.php' === $ slug ) { return ; } // Change login URL add_filter ( 'login_redirect' , function ( ) use ( $ slug ) { return site_url ( ) . $ slug ; } ) ; // Customize Site URL add_filter ( 'site_url' , function ( $ url ) use ( $ slug ) { return str_replace ( 'wp-login.php' , $ slug , $ url ) ; } , 10 , 3 ) ; // Make the redirection works properly add_filter ( 'wp_redirect' , function ( $ url ) use ( $ slug ) { return str_replace ( 'wp-login.php' , $ slug , $ url ) ; } , 10 , 2 ) ; }
Hiding `wp-login.php` in the login and registration URLs

@param string $slug
Hiding wp - login . php in the login and registration URLs