From 4c8566470355d3afb4badabf67d3778158bb270f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 12 Mar 2013 01:50:46 +0000 Subject: [PATCH] Avoid an undefined index notice in get_post_type_archive_feed_link(). props ericlewis. fixes #23744. git-svn-id: http://core.svn.wordpress.org/trunk@23660 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 9412db49e5..1daf48779c 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -867,9 +867,10 @@ function get_post_type_archive_feed_link( $post_type, $feed = '' ) { if ( ! $link = get_post_type_archive_link( $post_type ) ) return false; + $post_type_obj = get_post_type_object( $post_type ); - if ( $post_type_obj->rewrite['feeds'] && get_option( 'permalink_structure' ) ) { - $link = trailingslashit($link); + if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) { + $link = trailingslashit( $link ); $link .= 'feed/'; if ( $feed != $default_feed ) $link .= "$feed/";