WordPress.org

Make WordPress Core

Changeset 10937


Ignore:
Timestamp:
04/15/2009 07:14:43 PM (9 years ago)
Author:
ryan
Message:

Define wp_clone() before loading the cache.

Location:
trunk
Files:
2 edited

Legend:

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

    r10931 r10937  
    30313031}
    30323032
    3033 /**
    3034  * Copy an object.
    3035  *
    3036  * Returns a cloned copy of an object.
    3037  *
    3038  * @since 2.7.0
    3039  *
    3040  * @param object $object The object to clone
    3041  * @return object The cloned object
    3042  */
    3043 function wp_clone( $object ) {
    3044     static $can_clone;
    3045     if ( !isset( $can_clone ) ) {
    3046         $can_clone = version_compare( phpversion(), '5.0', '>=' );
    3047     }
    3048     return $can_clone ? clone( $object ) : $object;
    3049 }
    3050 
    30513033function get_site_option( $key, $default = false, $use_cache = true ) {
    30523034    return get_option($key, $default);
  • trunk/wp-settings.php

    r10910 r10937  
    270270if ( is_wp_error($prefix) )
    271271    wp_die(/*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/);
     272
     273/**
     274 * Copy an object.
     275 *
     276 * Returns a cloned copy of an object.
     277 *
     278 * @since 2.7.0
     279 *
     280 * @param object $object The object to clone
     281 * @return object The cloned object
     282 */
     283function wp_clone( $object ) {
     284    static $can_clone;
     285    if ( !isset( $can_clone ) ) {
     286        $can_clone = version_compare( phpversion(), '5.0', '>=' );
     287    }
     288    return $can_clone ? clone( $object ) : $object;
     289}
    272290
    273291if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) {
Note: See TracChangeset for help on using the changeset viewer.