Make WordPress Core


Ignore:
Timestamp:
02/09/2006 10:03:48 AM (20 years ago)
Author:
ryan
Message:

Allow draft pages. Use post_type for object types. Reserve post_status strictly for status. fixes #1820

File:
1 edited

Legend:

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

    r3508 r3510  
    4343
    4444    $post = &get_post($id);
    45     if ( $post->post_status == 'static' )
     45    if ( $post->post_type == 'page' )
    4646        return get_page_link($post->ID);
    47     elseif ($post->post_status == 'attachment')
     47    elseif ($post->post_type == 'attachment')
    4848        return get_attachment_link($post->ID);
    4949
     
    262262    }
    263263
    264     return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join WHERE post_date < '$current_post_date' AND post_status = 'publish' $posts_in_ex_cats_sql ORDER BY post_date DESC LIMIT 1");
     264    return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join WHERE post_date < '$current_post_date' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql ORDER BY post_date DESC LIMIT 1");
    265265}
    266266
     
    297297    $now = current_time('mysql');
    298298   
    299     return @$wpdb->get_row("SELECT ID,post_title FROM $wpdb->posts $join WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_status = 'publish' $posts_in_ex_cats_sql AND ID != $post->ID ORDER BY post_date ASC LIMIT 1");
     299    return @$wpdb->get_row("SELECT ID,post_title FROM $wpdb->posts $join WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql AND ID != $post->ID ORDER BY post_date ASC LIMIT 1");
    300300}
    301301
Note: See TracChangeset for help on using the changeset viewer.