dartmoon/wordpress-utils

Some general functions for wordpress

Installs: 130

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:wordpress-muplugin

v1.0.1 2023-05-19 13:51 UTC

This package is auto-updated.

Last update: 2024-04-18 11:24:45 UTC


README

A simple utils plugin that lets you register the same handler to multiple filters without much effort.

Installation

If you use a Roots Bedrock or a composer-based WordPress installation

composer require dartmoon/wordpress-utils

If you use a normal WordPress installation

  1. Download and install a MU plugin loader that lets you use MU plugins that resides inside folders. For example you could use Bedrock Autoloader.

  2. Download the latest release of this plugin and extract it inside the mu-plugins folder of your WordPress installation.

Usage

It behave exactly as add_filter with the only exception that the first argument (the filter name) accepts an array instead of a string.

add_filters(['filter1', 'filter2'], function () {
    // ...
});

License

This project is licensed under the MIT License - see the LICENSE.md file for details