From 9da891540811df36979858625dd1163c65983a73 Mon Sep 17 00:00:00 2001 From: "Drew Jaynes (DrewAPicture)" Date: Fri, 25 Apr 2014 06:23:31 +0000 Subject: [PATCH] Ensure the `register` filter hook is only documented once. See #26869. git-svn-id: https://develop.svn.wordpress.org/trunk@28208 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 27 ++++++++++++++------------- src/wp-login.php | 15 ++++++--------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index f4d6f37d66..baed666d5d 100644 --- a/src/wp-includes/general-template.php +++ b/src/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/src/wp-login.php b/src/wp-login.php index 7bb53343d1..f642145f5a 100644 --- a/src/wp-login.php +++ b/src/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; ?>