WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

Automattic\Jetpack\Autoloader\jp35ca907b2e70db60b0c2c7d0ef0fe4bd

Hook_Manager{} WC 1.0

Allows the latest autoloader to register hooks that can be removed when the autoloader is reset.

Хуков нет.

Возвращает

null. Ничего.

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

$Hook_Manager = new Hook_Manager();
// use class methods

Методы

  1. __construct()
  2. ERROR: no method name found on line ` *`
  3. ERROR: no method name found on line ` *`
  4. ERROR: no method name found on line ` *`
  5. add_action( $tag, $callable, $priority = 10, $accepted_args = 1 )
  6. ERROR: no method name found on line ` /**`
  7. ERROR: no method name found on line ` /**`
  8. ERROR: no method name found on line ` /**`
  9. add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 )
  10. ERROR: no method name found on line ` /**`
  11. ERROR: no method name found on line ` /**`
  12. ERROR: no method name found on line ` /**`
  13. reset()
  14. ERROR: no method name found on line ` );`
  15. ERROR: no method name found on line ` );`
  16. ERROR: no method name found on line ` );`

Код Hook_Manager{} WC 5.6.0

class Hook_Manager {

	/**
	 * An array containing all of the hooks that we've registered.
	 *
	 * @var array
	 */
	private $registered_hooks;

	/**
	 * The constructor.
	 */
	public function __construct() {
		$this->registered_hooks = array();
	}

	/**
	 * Adds an action to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the action which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the action.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_action( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Adds a filter to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the filter which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the filter.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_filter( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Removes all of the registered hooks.
	 */
	public function reset() {
		foreach ( $this->registered_hooks as $tag => $hooks ) {
			foreach ( $hooks as $hook ) {
				remove_filter( $tag, $hook['callable'], $hook['priority'] );
			}
		}
		$this->registered_hooks = array();
	}
}