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
This commit is contained in:
Drew Jaynes 2014-04-25 06:24:15 +00:00
parent a9b74e2088
commit 05537ab967
2 changed files with 20 additions and 22 deletions

View File

@ -544,21 +544,22 @@ function wp_register( $before = '<li>', $after = '</li>', $echo = true ) {
$link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $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;
}
}

View File

@ -544,13 +544,8 @@ case 'retrievepassword' :
<?php
if ( get_option( 'users_can_register' ) ) :
$registration_url = sprintf( '<a href="%s">%s</a>', 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' :
<?php
if ( get_option( 'users_can_register' ) ) :
$registration_url = sprintf( '<a href="%s">%s</a>', 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:
<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) :
if ( get_option( 'users_can_register' ) ) :
$registration_url = sprintf( '<a href="%s">%s</a>', 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;
?>