Make WordPress Core


Ignore:
Timestamp:
08/30/2006 09:46:31 PM (20 years ago)
Author:
ryan
Message:

Use get_option instead of get_settings. Just 'cause.

File:
1 edited

Legend:

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

    r4127 r4144  
    4646                case 'mysql':
    4747                        if ( $gmt ) $d = gmdate('Y-m-d H:i:s');
    48                         else $d = gmdate('Y-m-d H:i:s', (time() + (get_settings('gmt_offset') * 3600)));
     48                        else $d = gmdate('Y-m-d H:i:s', (time() + (get_option('gmt_offset') * 3600)));
    4949                        return $d;
    5050                        break;
    5151                case 'timestamp':
    5252                        if ( $gmt ) $d = time();
    53                         else $d = time() + (get_settings('gmt_offset') * 3600);
     53                        else $d = time() + (get_option('gmt_offset') * 3600);
    5454                        return $d;
    5555                        break;
     
    8989        $i = 86400;
    9090
    91         if ( $weekday < get_settings('start_of_week') )
    92                 $weekday = 7 - (get_settings('start_of_week') - $weekday);
    93 
    94         while ($weekday > get_settings('start_of_week')) {
     91        if ( $weekday < get_option('start_of_week') )
     92                $weekday = 7 - (get_option('start_of_week') - $weekday);
     93
     94        while ($weekday > get_option('start_of_week')) {
    9595                $weekday = date('w',$day);
    96                 if ( $weekday < get_settings('start_of_week') )
    97                         $weekday = 7 - (get_settings('start_of_week') - $weekday);
     96                if ( $weekday < get_option('start_of_week') )
     97                        $weekday = 7 - (get_option('start_of_week') - $weekday);
    9898
    9999                $day = $day - 86400;
     
    108108function get_lastpostdate($timezone = 'server') {
    109109        global $cache_lastpostdate, $pagenow, $wpdb;
    110         $add_seconds_blog = get_settings('gmt_offset') * 3600;
     110        $add_seconds_blog = get_option('gmt_offset') * 3600;
    111111        $add_seconds_server = date('Z');
    112112        if ( !isset($cache_lastpostdate[$timezone]) ) {
     
    131131function get_lastpostmodified($timezone = 'server') {
    132132        global $cache_lastpostmodified, $pagenow, $wpdb;
    133         $add_seconds_blog = get_settings('gmt_offset') * 3600;
     133        $add_seconds_blog = get_option('gmt_offset') * 3600;
    134134        $add_seconds_server = date('Z');
    135135        if ( !isset($cache_lastpostmodified[$timezone]) ) {
     
    165165/* Options functions */
    166166
    167 function get_settings($setting) {
     167function get_option($setting) {
    168168        global $wpdb;
    169169
     
    187187        // If home is not set use siteurl.
    188188        if ( 'home' == $setting && '' == $value )
    189                 return get_settings('siteurl');
     189                return get_option('siteurl');
    190190
    191191        if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting )
     
    193193
    194194        return apply_filters( 'option_' . $setting, maybe_unserialize($value) );
    195 }
    196 
    197 function get_option($option) {
    198         return get_settings($option);
    199195}
    200196
     
    291287
    292288function gzip_compression() {
    293         if ( !get_settings('gzipcompression') ) return false;
     289        if ( !get_option('gzipcompression') ) return false;
    294290
    295291        if ( extension_loaded('zlib') ) {
     
    325321                $link_text = $matches[4][$i];
    326322                $content = str_replace($link_match, $link_text.' '.$link_number, $content);
    327                 $link_url = ((strtolower(substr($link_url,0,7)) != 'http://') && (strtolower(substr($link_url,0,8)) != 'https://')) ? get_settings('home') . $link_url : $link_url;
     323                $link_url = ((strtolower(substr($link_url,0,7)) != 'http://') && (strtolower(substr($link_url,0,8)) != 'https://')) ? get_option('home') . $link_url : $link_url;
    328324                $links_summary .= "\n".$link_number.' '.$link_url;
    329325        }
     
    882878// Returns an array containing the current upload directory's path and url, or an error message.
    883879function wp_upload_dir() {
    884         $siteurl = get_settings('siteurl');
     880        $siteurl = get_option('siteurl');
    885881        //prepend ABSPATH to $dir and $siteurl to $url if they're not already there
    886         $path = str_replace(ABSPATH, '', trim(get_settings('upload_path')));
     882        $path = str_replace(ABSPATH, '', trim(get_option('upload_path')));
    887883        $dir = ABSPATH . $path;
    888884        $url = trailingslashit($siteurl) . $path;
     
    897893        }
    898894
    899         if ( get_settings('uploads_use_yearmonth_folders')) {
     895        if ( get_option('uploads_use_yearmonth_folders')) {
    900896                // Generate the yearly and monthly dirs
    901897                $time = current_time( 'mysql' );
     
    11021098        global $pagenow, $menu, $submenu, $parent_file, $submenu_file;
    11031099
    1104         $adminurl = get_settings('siteurl') . '/wp-admin';
     1100        $adminurl = get_option('siteurl') . '/wp-admin';
    11051101        if ( wp_get_referer() )
    11061102                $adminurl = wp_get_referer();
     
    11771173</head>
    11781174<body>
    1179         <h1 id="logo"><img alt="WordPress" src="<?php echo get_settings('siteurl'); ?>/wp-admin/images/wordpress-logo.png" /></h1>
     1175        <h1 id="logo"><img alt="WordPress" src="<?php echo get_option('siteurl'); ?>/wp-admin/images/wordpress-logo.png" /></h1>
    11801176        <p><?php echo $message; ?></p>
    11811177</body>
Note: See TracChangeset for help on using the changeset viewer.