sorry I realise I did not answer your question, it is a front end SPA, I pull all the urls from wordpress using:
add_action( ‘rest_api_init’, function () {
register_rest_route( ‘myplugin/v1’, ‘/author/(?P<id>\d+)’, array(
‘methods’ => ‘GET’,
‘callback’ => ‘my_awesome_func’,
) );
} );
(thats example above not actual code)
Is there any way to do this currently? I was thinking of having the theme check for you plugin and use the filter you use but not on template_redirect. Im happy to create a solution for myself to get it working then integrate it into the plugin (no charge of course!)
This is a similar issue to error I am getting. If I can solve issue of course will amend a fix
If there was an example to go from to double check would be sweeeellllll