Where to write custom code (CRUD) in WordPress

I am new to WordPress development and I am wondering what is correct/standard way to “connect” WordPress content (for instance pages) with custom application/database developed by me.

My goal is to use WordPress as CMS (themes, content/articles management, gallery, authentication) and issue custom code on particular pages, for instance:

I came from Java and I have experience with MVC – thats why I mentioned controller and MVC “style”.

What is common way to do that in WordPress? I am wondering where shall I “place/store” my custom Controllers and DAOs.

My idea is to write standalone MVC application and use REST API to exchange data between WordPress and my app. Im not sure whether “custom application” can be deployed somehow inside WordPress or need to stay as standalone application “next to” WordPress on server. Not sure if custom plugins may be utilized there. Or is there other way? If so, what are pros and cons of each?

Thanks!

Bài viết liên quan