PHPackages                             inpsyde/filter - 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. inpsyde/filter

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

inpsyde/filter
==============

Inpsyde Filter library.

1.1.0(8y ago)676.4k↓35.7%[1 PRs](https://github.com/inpsyde/filter/pulls)MITPHPPHP &gt;=5.5.0CI passing

Since Jun 2Pushed 1y ago12 watchersCompare

[ Source](https://github.com/inpsyde/filter)[ Packagist](https://packagist.org/packages/inpsyde/filter)[ RSS](/packages/inpsyde-filter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (6)Used By (0)

Inpsyde Filters [![Latest Stable Version](https://camo.githubusercontent.com/9564cdfa883a6e574b536e1c33b81dfe781fbf6108ffb87dd154dbc77dc423ea/68747470733a2f2f706f7365722e707567782e6f72672f696e70737964652f66696c7465722f762f737461626c65)](https://packagist.org/packages/inpsyde/filter) [![Project Status](https://camo.githubusercontent.com/5b5a2250da48f45495a817a4bcdabb5d101fff298acebe00a55a52815b7119ed/687474703a2f2f6f70656e736f757263652e626f782e636f6d2f6261646765732f6163746976652e737667)](http://opensource.box.com/badges) [![Build Status](https://camo.githubusercontent.com/a7958fec508872814f710e45bc464545f32b1e859802f8a53e69119a9a911c47/68747470733a2f2f7472617669732d63692e6f72672f696e70737964652f696e70737964652d66696c7465722e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/inpsyde/MetaboxOrchestra) [![License](https://camo.githubusercontent.com/88b1e6a27527f82b0269356121a233a3ce824547cf18752439fd7625a94e5691/68747470733a2f2f706f7365722e707567782e6f72672f696e70737964652f66696c7465722f6c6963656e7365)](https://packagist.org/packages/inpsyde/filter)
============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#inpsyde-filters----)

This package provides a collection of filters for WordPress.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Changing Options](#changing-options)
    - [Available Filters](#available-filters)
- [Create your own Filter](#create-your-own-filter)
- [Factory](#factory)
- [Other Notes](#other-notes)
    - [Bugs, technical hints or contribute](#bugs-technical-hints-or-contribute)
    - [License](#license)
    - [Changelog](#changelog)

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

[](#installation)

```
$ composer require --dev [--prefer-dist] inpsyde/filter

```

Usage
-----

[](#usage)

Each filter filters a value with a given configuration.

```
$filter = new Inpsyde\Filter\DateTime();
$value = $filter->filter( '21.06.1987' ); // converts to: 1987-06-21
```

### Changing Options

[](#changing-options)

Some filters are having additional options which can be overwritten in constructor.

```
$options = [
    'format' => 'd.m.Y'
];
$filter = new Inpsyde\Filter\DateTime( $options );
$value = $filter->filter( '1987-06-21' ); // 21.06.1987
```

### Available Filters

[](#available-filters)

Following basic filters are available:

- `ArrayValue`
- `DateTime`

In addition, there are filters which are wrappers for well known WordPress-functions:

- `WordPress\Absint`
- `WordPress\AutoP`
- `WordPress\EscHtml`
- `WordPress\EscUrlRaw`
- `WordPress\NormalizeWhitespace`
- `WordPress\RemoveAccents`
- `WordPress\SanitizeFileName`
- `WordPress\SanitizeKey`
- `WordPress\SanitizePostField`
- `WordPress\SanitizeTextField`
- `WordPress\SanitizeTitle`
- `WordPress\SanitizeTitleWithDashes`
- `WordPress\SanitizeUser`
- `WordPress\SpecialChars`
- `WordPress\StripTags`
- `WordPress\Unslash`

Create your own Filter
----------------------

[](#create-your-own-filter)

### File `My\Own\Filter\YourFilter.php`

[](#file-myownfilteryourfilterphp)

```
namespace My\Own\Filter;

use Inpsyde\Filter\AbstractFilter;

class YourFilter extends AbstractFilter {

    /**
     * Optional: set some options, which can be overwritten by constructor.

     * @var array
     */
    protected $options = [
        'key' => 'value'
    ];

    /**
     * {@inheritdoc}
     */
    public function filter( $value ) {
       // do something
       return $value;
    }

}
```

### Usage

[](#usage-1)

```
// Optional: set "new value" to Filter.
$options = [ 'key' => 'new value' ];

$filter = new YourFilter( $options );
$value = $filter->filter( 'my value' );
```

Factory
-------

[](#factory)

The library comes with a `FilterFactory` which allows you to create instances of new filters.

```
$factory = new \Inpsyde\Filter\FilterFactory();
$filter = $factory->create( 'DateTime' ); // returns instance of \Inpsyde\Filter\DateTime
```

The factory is also able to create instances of external classes, if they implement the `\Inpsyde\Filter\FilterInterface`:

```
$factory = new \Inpsyde\Filter\FilterFactory();
$filter = $factory->create( My\Own\Filter\YourFilter::class ); // Creates an instance of your own filter.
```

Other Notes
-----------

[](#other-notes)

### Bugs, technical hints or contribute

[](#bugs-technical-hints-or-contribute)

Please give us feedback, contribute and file technical bugs on [GitHub Repo](https://github.com/inpsyde/Inpsyde-Filter).

### License

[](#license)

This repository is a free software, and is released under the terms of the GNU General Public License version 2 or (at your option) any later version. See [LICENSE](./LICENSE) for complete license.

### Changelog

[](#changelog)

See [commits](https://github.com/inpsyde/Inpsyde-Filter/commits/master) or read [short version](https://github.com/inpsyde/Inpsyde-Filter/blob/master/CHANGELOG.md).

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1194 days

Total

4

Last Release

53d ago

PHP version history (2 changes)1.0PHP &gt;=5.4.0

1.0.1PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/003585053f7d5d2127d31d5a4e79ba309acc075154f5752de8f429ac42c54dbe?d=identicon)[Syde](/maintainers/Syde)

![](https://www.gravatar.com/avatar/572cb5d91b21cc9879823e849607ffe88365365391d5fd01ee4efb6a3c24df1f?d=identicon)[Chrico](/maintainers/Chrico)

![](https://www.gravatar.com/avatar/0fa321f6c73e14c16d4aea0276673ce1e5d001e49062e32f3b8dc91f0ed10c1e?d=identicon)[bueltge](/maintainers/bueltge)

---

Top Contributors

[![Chrico](https://avatars.githubusercontent.com/u/3417446?v=4)](https://github.com/Chrico "Chrico (20 commits)")[![bueltge](https://avatars.githubusercontent.com/u/133425?v=4)](https://github.com/bueltge "bueltge (3 commits)")[![MVarugh](https://avatars.githubusercontent.com/u/102949922?v=4)](https://github.com/MVarugh "MVarugh (1 commits)")

---

Tags

wordpresswordpress-filterswordpress-hooks

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/inpsyde-filter/health.svg)

```
[![Health](https://phpackages.com/badges/inpsyde-filter/health.svg)](https://phpackages.com/packages/inpsyde-filter)
```

###  Alternatives

[umpirsky/tld-list

List of all top-level domains in all data formats.

17766.6k](/packages/umpirsky-tld-list)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
