Jorge
Jorge

Reputation: 5676

How to make hooks in php

How can I make hooks in php. I am not sure on how wordpress process their hooks. This is a short example that I wanted to do.

I have a script tag on my register.php file and I wanted it to move on the **<head>**

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

Upvotes: 4

Views: 959

Answers (2)

XuDing
XuDing

Reputation: 2052

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

Upvotes: 1

Vladislav Rastrusny
Vladislav Rastrusny

Reputation: 29985

Look here: http://components.symfony-project.org/event-dispatcher/

It's a small and powerful hook library with full documentation

Upvotes: 3

Related Questions