What is the best practice to check for pretty permalinks?
I develop a plugin and therefore I add new RSS feeds. One feed might look like http://local.wordpress.dev/?post_type=custom-post-type&custom-taxonomy=tax-1&feed=custom-feed
This works pretty good. But if pretty permalinks are enabled also this url works which will be redirect to the same feed http://local.wordpress.dev/custom-taxonomy/tax-1/feed/custom-feed
.
So far so good. My plugin will list all available feeds for the user. My question what is the best practice to check if pretty permalinks are active and which url version should be displayed?
My idea is to look at $wp_rewrite
which permalink_structure
is set and decide which version to show. Is there a better way to do it?
Leave an answer