WP_Hook::do_all_hook() WordPress Method

The WP_Hook::do_all_hook() Wordpress method is used to call all of the registered functions for a particular hook, or to call all of the functions that have been registered for all hooks.

WP_Hook::do_all_hook( array $args ) #

Processes the functions hooked into the ‘all’ hook.


Parameters

$args

(array)(Required)Arguments to pass to the hook callbacks. Passed by reference.


Top ↑

Source

File: wp-includes/class-wp-hook.php

	public function do_all_hook( &$args ) {
		$nesting_level                      = $this->nesting_level++;
		$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );

		do {
			$priority = current( $this->iterations[ $nesting_level ] );

			foreach ( $this->callbacks[ $priority ] as $the_ ) {
				call_user_func_array( $the_['function'], $args );
			}
		} while ( false !== next( $this->iterations[ $nesting_level ] ) );

		unset( $this->iterations[ $nesting_level ] );
		$this->nesting_level--;
	}

Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.