Wordpress Hooks

How does wordpress implement hooks inside?

+3
source share
2 answers

Basically, it supports a global variable with a name $wp_filterfor storing relevant data. Plugins can use type functions add_filter()for registration.

At different points (hook points), Wordpress checks $wp_filterto see if there are any filters to run.

The easiest way to understand this is to look at wp-includes/plugin.phpand study the code there (or connect a debugger and go through it or configure firePHPand periodically upload data)

, , . , , .

+7

, .net .. u .. ... , , , .., , - WP.., , , .

0

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


All Articles