Changeset 34336
- Timestamp:
- 09/19/2015 08:09:05 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r34177 r34336 623 623 $feed = get_default_feed(); 624 624 625 $post = get_post( $post_id ); 626 $unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent; 627 625 628 if ( '' != get_option('permalink_structure') ) { 626 629 if ( 'page' == get_option('show_on_front') && $post_id == get_option('page_on_front') ) … … 629 632 $url = get_permalink($post_id); 630 633 631 $url = trailingslashit($url) . 'feed'; 632 if ( $feed != get_default_feed() ) 633 $url .= "/$feed"; 634 $url = user_trailingslashit($url, 'single_feed'); 634 if ( $unattached ) { 635 $url = home_url( '/feed/' ); 636 if ( $feed !== get_default_feed() ) { 637 $url .= "$feed/"; 638 } 639 $url = add_query_arg( 'attachment_id', $post_id, $url ); 640 } else { 641 $url = trailingslashit($url) . 'feed'; 642 if ( $feed != get_default_feed() ) 643 $url .= "/$feed"; 644 $url = user_trailingslashit($url, 'single_feed'); 645 } 635 646 } else { 636 $type = get_post_field('post_type', $post_id); 637 if ( 'page' == $type ) 647 if ( $unattached ) { 648 $url = add_query_arg( array( 'feed' => $feed, 'attachment_id' => $post_id ), home_url( '/' ) ); 649 } elseif ( 'page' == $post->post_type ) { 638 650 $url = add_query_arg( array( 'feed' => $feed, 'page_id' => $post_id ), home_url( '/' ) ); 639 else651 } else { 640 652 $url = add_query_arg( array( 'feed' => $feed, 'p' => $post_id ), home_url( '/' ) ); 653 } 641 654 } 642 655
Note: See TracChangeset
for help on using the changeset viewer.