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
This commit is contained in:
westi 2010-05-14 16:46:53 +00:00
parent 867628913e
commit 9570dfc394
2 changed files with 16 additions and 1 deletions

View File

@ -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.
*

View File

@ -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) )