PHPackages                             alleyinteractive/wp-filter-side-effects - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alleyinteractive/wp-filter-side-effects

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alleyinteractive/wp-filter-side-effects
=======================================

Use a WordPress filter like an action.

v2.0.0(3y ago)4434.5k↑11.4%12GPL-2.0-or-laterPHPPHP ^8.0

Since Jun 2Pushed 1y ago21 watchersCompare

[ Source](https://github.com/alleyinteractive/wp-filter-side-effects)[ Packagist](https://packagist.org/packages/alleyinteractive/wp-filter-side-effects)[ RSS](/packages/alleyinteractive-wp-filter-side-effects/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (2)

Filter Side Effects
===================

[](#filter-side-effects)

`add_filter_side_effect()` allows attaching a callback function to a WordPress filter without requiring that the callback function return the filtered value or even return any value. It wraps `add_filter()` and accepts the same arguments with the same defaults.

The callback function can return `void` or return a value. If the callback function returns a value, that value will be ignored, not passed back to the filter. Filter side effects thus behave like `add_action()` callbacks and can be used in situations where a call to `apply_filters()` signals that some behavior needs to occur, but no convenient action exists to run it.

Installation
------------

[](#installation)

Install the latest version with:

```
$ composer require alleyinteractive/wp-filter-side-effects
```

Basic usage
-----------

[](#basic-usage)

```
