Skip to content

Clean the admin login page a bit to remove the wordpress.org redirect #11

@cleverington

Description

@cleverington

These changes are pretty straightforward.

I would say WordPress.php, since that Class is focused on cleaning cruft.

/**
 * Add to existing run() function
 */
public function run() {
    add_filter( 'login_headerurl', array($this,'login_logo_url') );
    add_filter( 'login_headertext', array($this,'login_logo_url_title') );
}

/**
 * Reset - Login page 'home' URL on Logo
 *
 * This function resets the link URL of the header logo above the login form.
 * Changes the default from 'WordPress' to the site-homepage.
 *
 * @since 1.0.1
 * @see https://developer.wordpress.org/reference/hooks/login_headerurl/
 */
public static function login_logo_url() : void {
	return home_url();
}

/**
 * Reset - Header logo Link Text on Login page
 *
 * Filters the link text of the header logo above the login form on the login page.
 *
 * @since 0.1.1
 * @see https://developer.wordpress.org/reference/hooks/login_headertext/
 */
public static function login_logo_url_title() : void {
	return get_bloginfo( 'name' );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions