Make WordPress Core


Ignore:
Timestamp:
08/29/2008 07:25:45 AM (18 years ago)
Author:
azaozz
Message:

Pass default value to get_option(), fixes #7637

File:
1 edited

Legend:

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

    r8608 r8770  
    331331 * @return mixed Value set for the option.
    332332 */
    333 function get_option( $setting ) {
     333function get_option( $setting, $default = false ) {
    334334        global $wpdb;
    335335
    … …  
    342342        $notoptions = wp_cache_get( 'notoptions', 'options' );
    343343        if ( isset( $notoptions[$setting] ) )
    344                 return false;
     344                return $default;
    345345
    346346        $alloptions = wp_load_alloptions();
    … …  
    365365                                $notoptions[$setting] = true;
    366366                                wp_cache_set( 'notoptions', $notoptions, 'options' );
    367                                 return false;
     367                                return $default;
    368368                        }
    369369                }
Note: See TracChangeset for help on using the changeset viewer.