I have a site that must be deployed in a WP Multisite environment but none of the code in the site uses WordPress at all. How can I intercept WordPress, perhaps at ‘init’, and tell it to stop doing anything and let me take over?
I tried just putting everything in my index.php
file and include everything manually from there. However, this results in the <head>
of my page being loaded within the body. So it’s obvious that I need to interrupt WordPress before it can run wp_head()
, but don’t know how this might be done.
You could hook
init
and check the current blog IDThis will exit before WordPress does the main query and loads the template.
EDIT
a slightly earlier action you could hook is
after_setup_theme
, that seems to be the earliest thatget_current_blog_id
will work. See the action reference page for the order of actions.