Advertise the correct comment feed link for a Page on the Front. Do not canonical redirect the front page comments feeds to home. Fixes #12452

git-svn-id: https://develop.svn.wordpress.org/trunk@14141 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-04-18 06:51:16 +00:00
parent 7a1c3bdf27
commit 09c1f4eb75
2 changed files with 7 additions and 2 deletions

View File

@ -100,7 +100,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
} elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) {
if ( $redirect_url = get_permalink(get_query_var('page_id')) )
$redirect['query'] = remove_query_arg('page_id', $redirect['query']);
} elseif ( is_page() && isset($wp_query->queried_object) && 'page' == get_option('show_on_front') && $wp_query->queried_object->ID == get_option('page_on_front') && ! $redirect_url ) {
} elseif ( is_page() && !is_feed() && isset($wp_query->queried_object) && 'page' == get_option('show_on_front') && $wp_query->queried_object->ID == get_option('page_on_front') && ! $redirect_url ) {
$redirect_url = home_url('/');
} elseif ( is_home() && !empty($_GET['page_id']) && 'page' == get_option('show_on_front') && get_query_var('page_id') == get_option('page_for_posts') && ! $redirect_url ) {
if ( $redirect_url = get_permalink(get_option('page_for_posts')) )

View File

@ -471,7 +471,12 @@ function get_post_comments_feed_link($post_id = '', $feed = '') {
$feed = get_default_feed();
if ( '' != get_option('permalink_structure') ) {
$url = trailingslashit( get_permalink($post_id) ) . 'feed';
if ( 'page' == get_option('show_on_front') && $post_id == get_option('page_on_front') )
$url = _get_page_link( $post_id );
else
$url = get_permalink($post_id);
$url = trailingslashit($url) . 'feed';
if ( $feed != get_default_feed() )
$url .= "/$feed";
$url = user_trailingslashit($url, 'single_feed');