Skip to:

Re: Router for root components

Ok I’ve continued to work on this but I’ve run into abit of a snag. It seems that the standard status code from WP for a screen function is 404 unless a template is loaded. This is fine in most cases but in some cases you might not want to return anything and when it comes to AJAX you might want to return a JSON response. Setting the header yourself and putting die() at the end works but that’s pretty ugly and I’d like to “follow the rules” so to speak.

Does anyone know the best practice or convention for this? Very thankful for any ideas/help. I’ve updated the plugin in the repository to the latest version.

Skip to toolbar