WP_Hook::do_action()publicWP 4.7.0

Calls the callback functions that have been added to an action hook.

Метод класса: WP_Hook{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$WP_Hook = new WP_Hook();
$WP_Hook->do_action( $args );
$args(массив) (обязательный)
Parameters to pass to the callback functions.

Список изменений

С версии 4.7.0 Введена.

Код WP_Hook::do_action() WP 6.1.1

public function do_action( $args ) {
	$this->doing_action = true;
	$this->apply_filters( '', $args );

	// If there are recursive calls to the current action, we haven't finished it until we get to the last one.
	if ( ! $this->nesting_level ) {
		$this->doing_action = false;
	}
}