Hacker News new | ask | show | jobs
by fimdomeio 3271 days ago
I started separating the admin from the "theme" by using the wordpress rest api (admin running in a subdomain). While this might seem overkill at first but I find that there's a lot less documentation to read and I can reuse a lot more code from other projects without any changes.
4 comments

I love using the rest API like this. The main downside is you lose the inability to use many Wordpress plugins.

I.e., if your users want to insert a poll into a page, before you could probably install a plugin that integrates with the editor and admin panel. With this approach, you'll (probably) need to build that functionality yourself. So, your content and users need to be just right to do this.

Most of my WP sites don't do a lot. Can you use the rest API to handle the contact form and search? that was I could just use a static generation from wp itself. The wp admin wouldn't even need to be publically accessible then.
The WP API handle search but not contact forms. Most plugins still don't provide you with an API.

Contact form 7's latest build has them using their own API - but it's still undocumented.

Do you have any detailed notes on how you set this up? I haven't used WP in a long time, to be honest, so not sure how their rest api works? Is it straight forward? Would love to read about this setup you do, sounds great.
The REST API is included with WordPress 4.7+ and on by default. Docs here: https://developer.wordpress.org/rest-api/ (if you find anything missing, I'd love to know)
I can't picture developing WP themes without WP_Query class. Does that ever pose a problem for you?