Ticket #9291: feed_links_extra_DRY.patch
| File feed_links_extra_DRY.patch, 3.0 KB (added by , 17 years ago) |
|---|
-
wp-includes/general-template.php
1444 1444 1445 1445 if ( is_single() || is_page() ) { 1446 1446 $post = &get_post( $id = 0 ); 1447 if ( comments_open() || pings_open() || $post->comment_count > 0 ) 1448 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attribute_escape(sprintf( $args['singletitle'], get_bloginfo('name'), $args['seperator'], wp_specialchars( get_the_title() ) )) . '" href="' . get_post_comments_feed_link( $post->ID ) . "\" />\n"; 1447 1448 if ( comments_open() || pings_open() || $post->comment_count > 0 ) { 1449 $title = attribute_escape(sprintf( $args['singletitle'], get_bloginfo('name'), $args['seperator'], wp_specialchars( get_the_title() ) )); 1450 $href = get_post_comments_feed_link( $post->ID ); 1451 } 1449 1452 } 1450 1453 1451 1454 elseif ( is_category() ) { 1452 1455 $cat_id = intval( get_query_var('cat') ); 1453 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attribute_escape(sprintf( $args['cattitle'], get_bloginfo('name'), $args['seperator'], get_cat_name( $cat_id ) )) . '" href="' . get_category_feed_link( $cat_id ) . "\" />\n"; 1456 1457 $title = attribute_escape(sprintf( $args['cattitle'], get_bloginfo('name'), $args['seperator'], get_cat_name( $cat_id ) )); 1458 $href = get_category_feed_link( $cat_id ); 1454 1459 } 1455 1460 1456 1461 elseif ( is_tag() ) { 1457 1462 $tag_id = intval( get_query_var('tag_id') ); 1458 1463 $tag = get_tag( $tag_id ); 1459 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attribute_escape(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['seperator'], $tag->name )) . '" href="' . get_tag_feed_link( $tag_id ) . "\" />\n"; 1464 1465 $title = attribute_escape(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['seperator'], $tag->name )); 1466 $href = get_tag_feed_link( $tag_id ); 1460 1467 } 1461 1468 1462 1469 elseif ( is_author() ) { 1463 1470 $author_id = intval( get_query_var('author') ); 1464 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attribute_escape(sprintf( $args['authortitle'], get_bloginfo('name'), $args['seperator'], get_author_name( $author_id ) )) . '" href="' . get_author_feed_link( $author_id ) . "\" />\n"; 1471 1472 $title = attribute_escape(sprintf( $args['authortitle'], get_bloginfo('name'), $args['seperator'], get_author_name( $author_id ) )); 1473 $href = get_author_feed_link( $author_id ); 1465 1474 } 1466 1475 1467 1476 elseif ( is_search() ) { 1468 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . attribute_escape(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['seperator'], get_search_query() )) . '" href="' . get_search_feed_link() . "\" />\n"; 1477 $title = attribute_escape(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['seperator'], get_search_query() )); 1478 $href = get_search_feed_link(); 1469 1479 } 1480 1481 if ( empty($title) || empty($href) ) 1482 return; 1483 1484 echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . $title . '" href="' . $href . "\" />\n"; 1470 1485 } 1471 1486 1472 1487 /**
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)