Changeset 3510 for trunk/wp-includes/template-functions-links.php
- Timestamp:
- 02/09/2006 10:03:48 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/template-functions-links.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-links.php
r3508 r3510 43 43 44 44 $post = &get_post($id); 45 if ( $post->post_ status == 'static' )45 if ( $post->post_type == 'page' ) 46 46 return get_page_link($post->ID); 47 elseif ($post->post_ status== 'attachment')47 elseif ($post->post_type == 'attachment') 48 48 return get_attachment_link($post->ID); 49 49 … … 262 262 } 263 263 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"); 265 265 } 266 266 … … 297 297 $now = current_time('mysql'); 298 298 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"); 300 300 } 301 301
Note: See TracChangeset
for help on using the changeset viewer.