From 9570dfc3940b07bf73878730dd61477cc7216e8e Mon Sep 17 00:00:00 2001 From: westi Date: Fri, 14 May 2010 16:46:53 +0000 Subject: [PATCH] Introduce __return_zero() and use it instead of create_function in the login header. Also add version info to __return_true and __return_false. git-svn-id: http://svn.automattic.com/wordpress/trunk@14639 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 15 +++++++++++++++ wp-login.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index c38e56adb..b048db383 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -4128,6 +4128,7 @@ function _search_terms_tidy($t) { * * Useful for returning true to filters easily * + * @since 3.0.0 * @see __return_false() * @return bool true */ @@ -4140,6 +4141,7 @@ function __return_true() { * * Useful for returning false to filters easily * + * @since 3.0.0 * @see __return_true() * @return bool false */ @@ -4147,6 +4149,19 @@ function __return_false() { return false; } +/** + * Returns 0 + * + * Useful for returning 0 to filters easily + * + * @since 3.0.0 + * @see __return_zero() + * @return int 0 + */ +function __return_zero() { + return 0; +} + /** * Send a HTTP header to disable content type sniffing in browsers which support it. * diff --git a/wp-login.php b/wp-login.php index b6b11a429..c9756a3ae 100644 --- a/wp-login.php +++ b/wp-login.php @@ -42,7 +42,7 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { global $error, $is_iphone, $interim_login, $current_site; // Don't index any of these forms - add_filter( 'pre_option_blog_public', create_function( '$a', 'return 0;' ) ); + add_filter( 'pre_option_blog_public', '__return_zero' ); add_action( 'login_head', 'noindex' ); if ( empty($wp_error) )