I'm planning to build a simple application which includes modular functionality and I'm planning to use similar technology as WordPress uses, which is hooks!
I did some digging and didn't find a proper answer or found some but it's too confusing, so can somebody explain to me how the hooks functionality works and how can we implement it with core PHP!
My plan is to create a home page and add modules (like WordPress plugins) to the home page, I did a basic WordPress plugin and came across some hooks like add_action
, has_action
, remove_action
and so on, and some filters like add_filter
, has_filter
, remove_filter
and so on
how can we implement these functions from scratch with core PHP?
if there is any reference code, blog or the simple code to implement a basic hello world application will work!
I'm just trying to learn new things, please help me to add this functionality to the home page and explain to me the process if you can! thanks.