wp_registration_url()WP 3.6.0

Gets the URL for the registration page: wp-login.php?action=register.

The obtained URL can be used to display a link to user registration. However, the link will be displayed even when the user is logged in. To display a "smart" link: to the registration page or the admin panel depending on the authorization, use the function wp_register().

Used By: wp_register()
1 time — 0.000103 sec (fast) | 50000 times — 2.12 sec (fast)
Hooks from the function

Returns

String. URL.

Usage

wp_registration_url();

Examples

0

#1 Get a link to the registration page

$register_url = wp_registration_url();

echo $register_url; // http://example.com/wp-login.php?action=register
0

#2 Sample Registration Link

<a href="<?php echo esc_url( wp_registration_url() ); ?>">
	<?php esc_html_e( 'Register', 'textdomain' ); ?>
</a>

Changelog

Since 3.6.0 Introduced.

wp_registration_url() code WP 7.0

function wp_registration_url() {
	/**
	 * Filters the user registration URL.
	 *
	 * @since 3.6.0
	 *
	 * @param string $register The user registration URL.
	 */
	return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
}