PHPackages                             wpbones/actions-and-filters-js - 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. wpbones/actions-and-filters-js

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

wpbones/actions-and-filters-js
==============================

WordPress actions and filters in Javascript

1.0.7(1y ago)163MITJavaScript

Since Nov 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wpbones/actions-and-filters-js)[ Packagist](https://packagist.org/packages/wpbones/actions-and-filters-js)[ Docs](https://github.com/wpbones/actions-and-filters-js)[ RSS](/packages/wpbones-actions-and-filters-js/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (7)Used By (0)

WordPress actions and filters implementation for Javascript
===========================================================

[](#wordpress-actions-and-filters-implementation-for-javascript)

[![Latest Stable Version](https://camo.githubusercontent.com/0e81a5d8bf32e9f188c2fa28a2a88ef88db21f54697064c93ea221364331bc5b/68747470733a2f2f706f7365722e707567782e6f72672f7770626f6e65732f616374696f6e732d616e642d66696c746572732d6a732f762f737461626c653f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/wpbones/actions-and-filters-js) [![Latest Unstable Version](https://camo.githubusercontent.com/07f71220cf8f97c3f3d536d4481a1539c873b7b3d3d7776677377df4ded3a884/68747470733a2f2f706f7365722e707567782e6f72672f7770626f6e65732f616374696f6e732d616e642d66696c746572732d6a732f762f756e737461626c653f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/wpbones/actions-and-filters-js) [![Total Downloads](https://camo.githubusercontent.com/34f3f3730c68565374d2142ee93c9dae01b6ddf9aee06857e645dcec1601d849/68747470733a2f2f706f7365722e707567782e6f72672f7770626f6e65732f616374696f6e732d616e642d66696c746572732d6a732f646f776e6c6f6164733f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/wpbones/actions-and-filters-js) [![License](https://camo.githubusercontent.com/fed040657c8f7b3cb5e64943821b241f46abf79b20116d1c41083c8dc30aad41/68747470733a2f2f706f7365722e707567782e6f72672f7770626f6e65732f616374696f6e732d616e642d66696c746572732d6a732f6c6963656e73653f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/wpbones/actions-and-filters-js) [![Monthly Downloads](https://camo.githubusercontent.com/9d15b4e250e1fde1d8c34917227d6fce1b612e90851f6fff418f3673c7b9cb72/68747470733a2f2f706f7365722e707567782e6f72672f7770626f6e65732f616374696f6e732d616e642d66696c746572732d6a732f642f6d6f6e74686c793f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/wpbones/actions-and-filters-js)

A Javascript version of the actions and filters used in PHP in WordPress for WP Bones.

Requirements
------------

[](#requirements)

This package works with a WordPress plugin written with [WP Bones framework library](https://github.com/wpbones/WPBones).

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

[](#installation)

You can install third party packages by using:

```
php bones require wpbones/actions-and-filters-js
```

I advise to use this command instead of `composer require` because doing this an automatic renaming will done.

You can use composer to install this package:

```
composer require wpbones/actions-and-filters-js
```

You may also to add `"wpbones/actions-and-filters-js": "^1.0"` in the `composer.json` file of your plugin:

```
  "require": {
    "php": ">=7.4",
    "wpbones/wpbones": "~0.8",
    "wpbones/actions-and-filters-js": "~1.0"
  },
```

and run

```
composer install
```

Alternatively, you can get the single files `src/resources/assets/js/actions-and-filters.js` in your WP Bones plugin and compile it with `gulp`. Also, you can get pre-compiled minified version `src/public/js/actions-and-filters.min.js`.

Enqueue for Controller
----------------------

[](#enqueue-for-controller)

You can use the provider to enqueue the styles.

```
public function index()
{
  // enqueue the minified version
  ActionsAndFiltersJSProvider::enqueueScripts();

  // ...

}
```

ActionsAndFiltersJSProvider
---------------------------

[](#actionsandfiltersjsprovider)

This is a static class autoloaded by composer. You can use it to enqueue or get the styles path:

```
// enqueue the minified version
ActionsAndFiltersJSProvider::enqueueScripts();

// enqueue the flat version
ActionsAndFiltersJSProvider::enqueueScripts( false );

// return the absolute path of the minified css
ActionsAndFiltersJSProvider::js();

// return the absolute path of the flat css
ActionsAndFiltersJSProvider::js();
```

Usage
-----

[](#usage)

Let's an example:

```
wpbones_add_action( 'my-action', function() { alert( "Hello" ) } );

...

wpbones_do_action( 'my-action' );
```

This Javascript version works in the same way than PHP version in WordPress.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance42

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~719 days

Total

5

Last Release

636d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3eb65ad928faf1a3303497a2f9e3bb8db51ebcb09dc21c6ddc3546b4bdc9c2b4?d=identicon)[gfazioli](/maintainers/gfazioli)

---

Top Contributors

[![gfazioli](https://avatars.githubusercontent.com/u/432181?v=4)](https://github.com/gfazioli "gfazioli (9 commits)")

---

Tags

javascriptwordpresswordpress-actionswordpress-developmentwp-boneswp-bones-packagesjavascriptfiltersactionsWP Bones

### Embed Badge

![Health badge](/badges/wpbones-actions-and-filters-js/health.svg)

```
[![Health](https://phpackages.com/badges/wpbones-actions-and-filters-js/health.svg)](https://phpackages.com/packages/wpbones-actions-and-filters-js)
```

###  Alternatives

[tightenco/ziggy

Use your Laravel named routes in JavaScript.

4.3k45.9M309](/packages/tightenco-ziggy)[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k32.3M423](/packages/matthiasmullie-minify)[tedivm/jshrink

Javascript Minifier built in PHP

76239.0M172](/packages/tedivm-jshrink)[tormjens/eventy

The WordPress filter/action system in Laravel

438937.3k23](/packages/tormjens-eventy)[bainternet/php-hooks

A fork of the WordPress filters hook system rolled in to a class to be ported into any PHP-based system

27623.1k5](/packages/bainternet-php-hooks)[voku/php-hooks

A fork of the WordPress filters hook system rolled in to a class to be ported into any PHP-based system

8338.8k3](/packages/voku-php-hooks)

PHPackages © 2026

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