Why don't you use the add_feed() function instead of the custom sniff $has_markdown_type = $has_accept_header && 1 === preg_match( '~^text/(?:x-)?markdown(?:;|$)~', $_SERVER['HTTP_ACCEPT'] ); I believe it will do all the heavy lifting See my core patch https://github.com/WordPress/wordpress-develop/pull/10599
Why don't you use the add_feed() function instead of the custom sniff
I believe it will do all the heavy lifting
See my core patch WordPress/wordpress-develop#10599