Make WordPress Core


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

Use get_option instead of get_settings. Just 'cause.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r4133 r4144  
    4848        return get_attachment_link($post->ID);
    4949
    50     $permalink = get_settings('permalink_structure');
     50    $permalink = get_option('permalink_structure');
    5151
    5252    if ( '' != $permalink && 'draft' != $post->post_status ) {
     
    7878            $post->post_name,
    7979        );
    80         return apply_filters('post_link', get_settings('home') . str_replace($rewritecode, $rewritereplace, $permalink), $post);
     80        return apply_filters('post_link', get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink), $post);
    8181    } else { // if they're not using the fancy permalink option
    82         $permalink = get_settings('home') . '/?p=' . $post->ID;
     82        $permalink = get_option('home') . '/?p=' . $post->ID;
    8383        return apply_filters('post_link', $permalink, $post);
    8484    }
     
    101101        $link = get_page_uri($id);
    102102        $link = str_replace('%pagename%', $link, $pagestruct);
    103         $link = get_settings('home') . "/$link/";
    104     } else {
    105         $link = get_settings('home') . "/?page_id=$id";
     103        $link = get_option('home') . "/$link/";
     104    } else {
     105        $link = get_option('home') . "/?page_id=$id";
    106106    }
    107107
    108108    if ( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') )
    109         $link = get_settings('home');
     109        $link = get_option('home');
    110110
    111111    return apply_filters('page_link', $link, $id);
     
    139139    global $wp_rewrite;
    140140    if ( !$year )
    141         $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600));
     141        $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
    142142    $yearlink = $wp_rewrite->get_year_permastruct();
    143143    if ( !empty($yearlink) ) {
    144144        $yearlink = str_replace('%year%', $year, $yearlink);
    145         return apply_filters('year_link', get_settings('home') . trailingslashit($yearlink), $year);
    146     } else {
    147         return apply_filters('year_link', get_settings('home') . '/?m=' . $year, $year);
     145        return apply_filters('year_link', get_option('home') . trailingslashit($yearlink), $year);
     146    } else {
     147        return apply_filters('year_link', get_option('home') . '/?m=' . $year, $year);
    148148    }
    149149}
     
    152152    global $wp_rewrite;
    153153    if ( !$year )
    154         $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600));
     154        $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
    155155    if ( !$month )
    156         $month = gmdate('m', time()+(get_settings('gmt_offset') * 3600));
     156        $month = gmdate('m', time()+(get_option('gmt_offset') * 3600));
    157157    $monthlink = $wp_rewrite->get_month_permastruct();
    158158    if ( !empty($monthlink) ) {
    159159        $monthlink = str_replace('%year%', $year, $monthlink);
    160160        $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
    161         return apply_filters('month_link', get_settings('home') . trailingslashit($monthlink), $year, $month);
    162     } else {
    163         return apply_filters('month_link', get_settings('home') . '/?m=' . $year . zeroise($month, 2), $year, $month);
     161        return apply_filters('month_link', get_option('home') . trailingslashit($monthlink), $year, $month);
     162    } else {
     163        return apply_filters('month_link', get_option('home') . '/?m=' . $year . zeroise($month, 2), $year, $month);
    164164    }
    165165}
     
    168168    global $wp_rewrite;
    169169    if ( !$year )
    170         $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600));
     170        $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600));
    171171    if ( !$month )
    172         $month = gmdate('m', time()+(get_settings('gmt_offset') * 3600));
     172        $month = gmdate('m', time()+(get_option('gmt_offset') * 3600));
    173173    if ( !$day )
    174         $day = gmdate('j', time()+(get_settings('gmt_offset') * 3600));
     174        $day = gmdate('j', time()+(get_option('gmt_offset') * 3600));
    175175
    176176    $daylink = $wp_rewrite->get_day_permastruct();
     
    179179        $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink);
    180180        $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
    181         return apply_filters('day_link', get_settings('home') . trailingslashit($daylink), $year, $month, $day);
    182     } else {
    183         return apply_filters('day_link', get_settings('home') . '/?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day);
     181        return apply_filters('day_link', get_option('home') . trailingslashit($daylink), $year, $month, $day);
     182    } else {
     183        return apply_filters('day_link', get_option('home') . '/?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day);
    184184    }
    185185}
     
    188188    global $wp_rewrite;
    189189    $do_perma = 0;
    190     $feed_url = get_settings('siteurl');
     190    $feed_url = get_option('siteurl');
    191191    $comment_feed_url = $feed_url;
    192192
     
    203203        $permalink = str_replace('%feed%', $feed, $permalink);
    204204        $permalink = preg_replace('#/+#', '/', "/$permalink/");
    205         $output =  get_settings('home') . $permalink;
     205        $output =  get_option('home') . $permalink;
    206206    } else {
    207207        if ( false !== strpos($feed, 'comments_') )
    208208            $feed = str_replace('comments_', 'comments-', $feed);
    209209
    210         $output = get_settings('home') . "/?feed={$feed}";
     210        $output = get_option('home') . "/?feed={$feed}";
    211211    }
    212212
     
    230230    }
    231231
    232     $location = get_settings('siteurl') . "/wp-admin/{$file}.php?action=edit&post=$post->ID";
     232    $location = get_option('siteurl') . "/wp-admin/{$file}.php?action=edit&post=$post->ID";
    233233    echo $before . "<a href=\"$location\">$link</a>" . $after;
    234234}
     
    245245    }
    246246
    247     $location = get_settings('siteurl') . "/wp-admin/comment.php?action=editcomment&amp;comment=$comment->comment_ID";
     247    $location = get_option('siteurl') . "/wp-admin/comment.php?action=editcomment&amp;comment=$comment->comment_ID";
    248248    echo $before . "<a href='$location'>$link</a>" . $after;
    249249}
     
    363363    $permalink = 0;
    364364
    365     $home_root = parse_url(get_settings('home'));
     365    $home_root = parse_url(get_option('home'));
    366366    $home_root = $home_root['path'];
    367367    $home_root = trailingslashit($home_root);
     
    391391            $qstr .=    '&amp;' . $page_querystring . '=' . $pagenum;
    392392            // otherwise, it could be rewritten, OR just the default index ...
    393         } elseif( '' != get_settings('permalink_structure') && ! is_admin() ) {
     393        } elseif( '' != get_option('permalink_structure') && ! is_admin() ) {
    394394            $permalink = 1;
    395395            $index = $wp_rewrite->index;
     
    413413    if ( $permalink )
    414414        $qstr = trailingslashit($qstr);
    415     $qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', trailingslashit( get_settings('home') ) . $qstr );
     415    $qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', trailingslashit( get_option('home') ) . $qstr );
    416416
    417417    // showing /page/1/ or ?paged=1 is redundant
Note: See TracChangeset for help on using the changeset viewer.