How to make hooks in php

How to make hooks in php. I'm not sure how Wordpress handles its hooks. This is a short example that I wanted to do.

I have a script tag in my register.php file and I wanted it to navigate **<head>**

I need an example of how to do this. Thanks in advance.

+4
source share
2 answers

Have a look here: http://components.symfony-project.org/event-dispatcher/

This is a small and powerful library with full documentation.

+3
source

I think you should take a look at one observer pattern design template .

+1
source

Source: https://habr.com/ru/post/1342984/


All Articles