M
M
Molluscusio2015-12-11 14:33:42
WordPress
Molluscusio, 2015-12-11 14:33:42

How to execute a PHP function before Wordpress generates a page?

0. Follow the link ( www.site.io || www.site.io/dir )
2. PHP function is executed
3. Wordpress generates the page
It is desirable to do this without hacking the engine

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MetaDone, 2015-12-11
@Molluscusio

add_action("init",function(){
//здесь то, что нужно сделать
});

enter in the functions.php of your theme. you can google the firing order of events in wordpress, init is the very first

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question