mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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:
parent
a9b74e2088
commit
05537ab967
@ -544,21 +544,22 @@ function wp_register( $before = '<li>', $after = '</li>', $echo = true ) {
|
|||||||
$link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after;
|
$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 ) {
|
if ( $echo ) {
|
||||||
/**
|
echo $link;
|
||||||
* 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 );
|
|
||||||
} else {
|
} else {
|
||||||
/** This filter is documented in wp-includes/general-template.php */
|
return $link;
|
||||||
return apply_filters( 'register', $link );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
wp-login.php
15
wp-login.php
@ -544,13 +544,8 @@ case 'retrievepassword' :
|
|||||||
<?php
|
<?php
|
||||||
if ( get_option( 'users_can_register' ) ) :
|
if ( get_option( 'users_can_register' ) ) :
|
||||||
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
|
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
|
||||||
/**
|
|
||||||
* Filter the registration URL below the login form.
|
/** This filter is documented in wp-includes/general-template.php */
|
||||||
*
|
|
||||||
* @since 1.5.0
|
|
||||||
*
|
|
||||||
* @param string $registration_url Registration URL.
|
|
||||||
*/
|
|
||||||
echo ' | ' . apply_filters( 'register', $registration_url );
|
echo ' | ' . apply_filters( 'register', $registration_url );
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
@ -635,7 +630,8 @@ case 'rp' :
|
|||||||
<?php
|
<?php
|
||||||
if ( get_option( 'users_can_register' ) ) :
|
if ( get_option( 'users_can_register' ) ) :
|
||||||
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( '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 );
|
echo ' | ' . apply_filters( 'register', $registration_url );
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
@ -892,7 +888,8 @@ default:
|
|||||||
<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) :
|
<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) :
|
||||||
if ( get_option( 'users_can_register' ) ) :
|
if ( get_option( 'users_can_register' ) ) :
|
||||||
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( '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 ) . ' | ';
|
echo apply_filters( 'register', $registration_url ) . ' | ';
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user