Make WordPress Core


Ignore:
Timestamp:
03/12/2006 10:57:00 PM (18 years ago)
Author:
ryan
Message:

Rewrite API additions and improvements from David House. #2433

File:
1 edited

Legend:

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

    r3634 r3638  
    22412241function load_template($file) {
    22422242    global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query,
    2243         $wp_rewrite, $wpdb;
     2243        $wp_rewrite, $wpdb, $wp_version, $wp;
    22442244
    22452245    extract($wp_query->query_vars);
     
    24352435    return 0;
    24362436}
     2437
     2438function do_feed() {
     2439    $feed = get_query_var('feed');
     2440
     2441    // Remove the pad, if present.
     2442    $feed = preg_replace('/^_+/', '', $feed);
     2443
     2444    if ($feed == '' || $feed == 'feed')
     2445        $feed = 'rss2';
     2446
     2447    $for_comments = false;
     2448    if ( is_single() || ($withcomments == 1) ) {
     2449        $feed = 'rss2';
     2450        $for_comments = true;   
     2451    }
     2452
     2453    $hook = 'do_feed_' . $feed;
     2454    do_action($hook, $for_comments);
     2455}
     2456
     2457function do_feed_rdf() {
     2458    load_template(ABSPATH . 'wp-rdf.php');
     2459}
     2460
     2461function do_feed_rss() {
     2462    load_template(ABSPATH . 'wp-rss.php');
     2463}
     2464
     2465function do_feed_rss2($for_comments) {
     2466    if ( $for_comments )
     2467        load_template(ABSPATH . 'wp-commentsrss2.php');
     2468    else
     2469        load_template(ABSPATH . 'wp-rss2.php');
     2470}
     2471
     2472function do_feed_atom() {
     2473    load_template(ABSPATH . 'wp-atom.php');
     2474}
    24372475?>
Note: See TracChangeset for help on using the changeset viewer.