downshiftorg/wp-event-emitter

An object oriented event emitter for WordPress actions

Maintainers

Package info

github.com/downshiftorg/wp-event-emitter

pkg:composer/downshiftorg/wp-event-emitter

Statistics

Installs: 11 262

Dependents: 4

Suggesters: 0

Stars: 17

Open Issues: 2

6.0.0 2018-01-15 17:42 UTC

This package is not auto-updated.

Last update: 2026-03-15 13:05:37 UTC


README

An object oriented event emitter for WordPress actions

Motivation

A familiar event interface that delegates to the global add_action and do_action functions of WordPress. It also presents a much more testable interface as it only uses the WP functions if they are available.

Methods

on

Delegate to WordPress' add_action function. In test environments a local collection of listeners will be used.

emit

Delegate to WordPress' do_action function. In test environments a local collection of listeners will be used.

filter

Delegate to WordPress' add_filter function. In test environments a local collection of listeners will be used.

applyFilters

Delegate to WordPress' apply_filters function. In test environments a local collection of listeners will be used.

Tests

Tests use PHPUnit

$ vendor/bin/phpunit