WordPress.org

Make WordPress Core

Ticket #44071: feed-link-modified.patch

File feed-link-modified.patch, 1.1 KB (added by akshayar, 2 years ago)
Line 
1@@ -2719,7 +2719,9 @@ function feed_links_extra( $args = array() ) {
2 
3        $post_type_obj = get_post_type_object( $post_type );
4        $title = sprintf( $args['posttypetitle'], get_bloginfo( 'name' ), $args['separator'], $post_type_obj->labels->name );
5-       $href = get_post_type_archive_feed_link( $post_type_obj->name );
6+       if ( $post_type_obj ) {
7+           $href = get_post_type_archive_feed_link( $post_type_obj->name );
8+       }
9    } elseif ( is_category() ) {
10        $term = get_queried_object();
11 
12@@ -2747,11 +2749,6 @@ function feed_links_extra( $args = array() ) {
13    } elseif ( is_search() ) {
14        $title = sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query( false ) );
15        $href = get_search_feed_link();
16-   } elseif ( is_post_type_archive() ) {
17-       $title = sprintf( $args['posttypetitle'], get_bloginfo('name'), $args['separator'], post_type_archive_title( '', false ) );
18-       $post_type_obj = get_queried_object();
19-       if ( $post_type_obj )
20-           $href = get_post_type_archive_feed_link( $post_type_obj->name );
21    }
22 
23    if ( isset($title) && isset($href) )