From 05537ab96793534c9022be4c0644936d7fa9ac9e Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Fri, 25 Apr 2014 06:24:15 +0000 Subject: [PATCH] Ensure the `register` filter hook is only documented once. See #26869. Built from https://develop.svn.wordpress.org/trunk@28208 git-svn-id: http://core.svn.wordpress.org/trunk@28038 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 27 ++++++++++++++------------- wp-login.php | 15 ++++++--------- 2 files changed, 20 insertions(+), 22 deletions(-) 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; ?>