WP_Hook::do_action()publicWP 4.7.0

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

{} It's a method of the class: WP_Hook{}

No Hooks.


null. Nothing.


$WP_Hook = new WP_Hook();
$WP_Hook->do_action( $args );
$args(array) (required)
Parameters to pass to the callback functions.


Since 4.7.0 Introduced.

Code of WP_Hook::do_action() WP 6.0

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;