||
preg_match( "#/{
$wp_rewrite->comments_pagination_base
}-[0-9]+(/+)?$#",
$redirect['path'
] ) ) { // Strip off any existing paging.
$redirect['path'
] =
preg_replace( "#/
$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/',
$redirect['path'
] );
// Strip off feed endings.
$redirect['path'
] =
preg_replace( '#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/',
$redirect['path'
] );
// Strip off any existing comment paging.
$redirect['path'
] =
preg_replace( "#/{
$wp_rewrite->comments_pagination_base
}-[0-9]+?(/+)?$#", '/',
$redirect['path'
] );
} $addl_path = '';
$default_feed =
get_default_feed();
if ( is_feed() &&
in_array( $feed,
$wp_rewrite->feeds, true
) ) { $addl_path = !
empty( $addl_path ) ?
trailingslashit( $addl_path ) : '';
if ( !
is_singular() &&
get_query_var( 'withcomments'
) ) { $addl_path .= 'comments/';
} if ( ( 'rss' ===
$default_feed && 'feed' ===
$feed ) || 'rss' ===
$feed ) { $format =
( 'rss2' ===
$default_feed ) ? '' : 'rss2';
} else {