diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index f4d6f37d66..baed666d5d 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -544,21 +544,22 @@ function wp_register( $before = '
', $after = '', $echo = true ) {
$link = $before . '' . __('Site Admin') . '' . $after;
}
+ /**
+ * Filter the HTML link to the Registration or Admin page.
+ *
+ * Users are sent to the admin page if logged-in, or the registration page
+ * if enabled and logged-out.
+ *
+ * @since 1.5.0
+ *
+ * @param string $link The HTML code for the link to the Registration or Admin page.
+ */
+ $link = apply_filters( 'register', $link );
+
if ( $echo ) {
- /**
- * Filter the HTML link to the Registration or Admin page.
- *
- * Users are sent to the admin page if logged-in, or the registration page
- * if enabled and logged-out.
- *
- * @since 1.5.0
- *
- * @param string $link The HTML code for the link to the Registration or Admin page.
- */
- echo apply_filters( 'register', $link );
+ echo $link;
} else {
- /** This filter is documented in wp-includes/general-template.php */
- return apply_filters( 'register', $link );
+ return $link;
}
}
diff --git a/wp-login.php b/wp-login.php
index 7bb53343d1..f642145f5a 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -544,13 +544,8 @@ case 'retrievepassword' :
%s', esc_url( wp_registration_url() ), __( 'Register' ) );
- /**
- * Filter the registration URL below the login form.
- *
- * @since 1.5.0
- *
- * @param string $registration_url Registration URL.
- */
+
+ /** This filter is documented in wp-includes/general-template.php */
echo ' | ' . apply_filters( 'register', $registration_url );
endif;
?>
@@ -635,7 +630,8 @@ case 'rp' :
%s', esc_url( wp_registration_url() ), __( 'Register' ) );
- /** This filter is documented in wp-login.php */
+
+ /** This filter is documented in wp-includes/general-template.php */
echo ' | ' . apply_filters( 'register', $registration_url );
endif;
?>
@@ -892,7 +888,8 @@ default:
%s', esc_url( wp_registration_url() ), __( 'Register' ) );
- /** This filter is documented in wp-login.php */
+
+ /** This filter is documented in wp-includes/general-template.php */
echo apply_filters( 'register', $registration_url ) . ' | ';
endif;
?>