WordPress.org

Make WordPress Core

Changeset 14641


Ignore:
Timestamp:
05/14/2010 04:55:26 PM (8 years ago)
Author:
westi
Message:

Introduce return_empty_array() and use it instead of create_function in the theme preview.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r14639 r14641  
    41644164
    41654165/**
     4166 * Returns an empty array
     4167 *
     4168 * Useful for returning an empty array to filters easily
     4169 *
     4170 * @since 3.0.0
     4171 * @see __return_zero()
     4172 * @return array Empty array
     4173 */
     4174function __return_empty_array() {
     4175    return array();
     4176}
     4177
     4178/**
    41664179 * Send a HTTP header to disable content type sniffing in browsers which support it.
    41674180 *
  • trunk/wp-includes/theme.php

    r14610 r14641  
    11121112
    11131113    // Prevent theme mods to current theme being used on theme being previewed
    1114     add_filter( 'pre_option_mods_' . get_current_theme(), create_function( '', "return array();" ) );
     1114    add_filter( 'pre_option_mods_' . get_current_theme(), '__return_empty_array' );
    11151115
    11161116    ob_start( 'preview_theme_ob_filter' );
Note: See TracChangeset for help on using the changeset viewer.