From cf9f85dc8121a359d550ffa3b735fb48859eee88 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 24 Apr 2008 11:45:39 +0000 Subject: Merged with WP 2.5, revision 7806 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1260 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/link-template.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'wp-includes/link-template.php') diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 23bfbf7..74da3e7 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -80,13 +80,13 @@ function get_permalink($id = 0, $leavename=false) { $category = $cats[0]->slug; if ( $parent=$cats[0]->parent ) $category = get_category_parents($parent, FALSE, '/', TRUE) . $category; - } - // show default category in permalinks, without - // having to assign it explicitly - if ( empty($category) ) { - $default_category = get_category( get_option( 'default_category' ) ); - $category = is_wp_error( $default_category)? '' : $default_category->slug; + // show default category in permalinks, without + // having to assign it explicitly + if ( empty($category) ) { + $default_category = get_category( get_option( 'default_category' ) ); + $category = is_wp_error( $default_category ) ? '' : $default_category->slug; + } } $author = ''; @@ -179,7 +179,7 @@ function get_attachment_link($id = false) { $parentlink = _get_page_link( $object->post_parent ); // Ignores page_on_front else $parentlink = get_permalink( $object->post_parent ); - if ( ctype_digit($object->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') ) + if ( is_numeric($object->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') ) $name = 'attachment/' . $object->post_name; // // is paged so we use the explicit attachment marker else $name = $object->post_name; @@ -554,7 +554,7 @@ function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $pre } if ( !empty($excluded_categories) ) { - $posts_in_ex_cats_sql = " AND tt.term_id NOT IN (" . implode($excluded_categories, ',') . ')'; + $posts_in_ex_cats_sql = " AND tt.taxonomy = 'category' AND tt.term_id NOT IN (" . implode($excluded_categories, ',') . ')'; } } } -- cgit