mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Introduce __return_empty_array() and use it instead of create_function in the theme preview.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
366d182843
commit
83ae6a51ea
@ -4162,6 +4162,19 @@ function __return_zero() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an empty array
|
||||
*
|
||||
* Useful for returning an empty array to filters easily
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @see __return_zero()
|
||||
* @return array Empty array
|
||||
*/
|
||||
function __return_empty_array() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a HTTP header to disable content type sniffing in browsers which support it.
|
||||
*
|
||||
|
@ -1111,7 +1111,7 @@ function preview_theme() {
|
||||
}
|
||||
|
||||
// Prevent theme mods to current theme being used on theme being previewed
|
||||
add_filter( 'pre_option_mods_' . get_current_theme(), create_function( '', "return array();" ) );
|
||||
add_filter( 'pre_option_mods_' . get_current_theme(), '__return_empty_array' );
|
||||
|
||||
ob_start( 'preview_theme_ob_filter' );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user