I tried to search on Google but couldn't find any good tutorial or article.
Hooks allow developers to change or extend WordPress' functionality without needing to edit the WordPress core code itself. They do this by running actions and filters, which are PHP functions that perform tasks and make changes to data. They are used extensively by plugin and theme developers.
Hooks are a category of function that allows base code to call extension code. This can be useful in situations in which a core developer wants to offer extensibility without exposing their code.
In programming, a hook is a place and usually an interface provided in packaged code that allows a programmer to insert customized programming. For example, a programmer might want to provide code that analyzed how often a particular logic path was taken within a program.
There are two types of hooks: Actions and Filters. To use either, you need to write a custom function known as a Callback , and then register it with a WordPress hook for a specific action or filter.
You probably couldn't find anything because PHP doesn't have a concept of hooks in the first place.
Hooks are a kind of function which you can plug (or hook) to an existing system to extend its functionality. They aren't specific to the PHP language or to any system. They may also be called plugins, add-ons or extensions.
Now, while PHP doesn't have a concept of hooks, it does allow you to compile extensions together with the PHP core to gain added functionality for use in your scripts. There are plenty of PHP extensions bundled by default. This is an example of what I described above.
Yeah, hooks aren't native PHP methods.. they're used to extend functionality from a framework's core.
Codeigniter Hooks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With