PHPackages                             bmd/enable-button-icons - 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. bmd/enable-button-icons

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

bmd/enable-button-icons
=======================

Extension to add icons to Button blocks.

v0.3.2(2mo ago)041GPL-2.0-or-laterPHPCI failing

Since Apr 24Pushed 2mo agoCompare

[ Source](https://github.com/bob-moore/enable-button-icons)[ Packagist](https://packagist.org/packages/bmd/enable-button-icons)[ Docs](https://github.com/bob-moore/Block-Preset-Classes)[ RSS](/packages/bmd-enable-button-icons/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

Enable Button Icons
===================

[](#enable-button-icons)

[![Enable Button Icons](assets/banner-1544x500.jpg)](assets/banner-1544x500.jpg)

[![WordPress](https://camo.githubusercontent.com/37248c7b4f293acfd4db49b12db9762dc0dc5fc99b9754d4f7d9d9a648c01018/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576f726450726573732d362e392532422d3338353865393f6c6f676f3d776f72647072657373266c6f676f436f6c6f723d666666)](https://wordpress.org/)[![PHP](https://camo.githubusercontent.com/8da406bc1dd3dcb38541095055eef712a822936eee12a6c185a71f6e678091b2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737376262343f6c6f676f3d706870266c6f676f436f6c6f723d666666)](https://www.php.net/)[![Latest Release](https://camo.githubusercontent.com/2b98d078129a2f129d803bd0e2fc22fbd12d85400ad782477fa935824dc5b540/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f626f622d6d6f6f72652f656e61626c652d627574746f6e2d69636f6e733f6c6162656c3d72656c65617365)](https://github.com/bob-moore/enable-button-icons/releases/latest)[![License](https://camo.githubusercontent.com/cd781d0568c328bdea35f284d33e2b1e96675ef60910926c1dd75d5a4d46de66/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c2d2d322e302d2d6f722d2d6c617465722d626c7565)](https://www.gnu.org/licenses/gpl-2.0.html)

[![Lint CSS](https://github.com/bob-moore/enable-button-icons/actions/workflows/lint-css.yml/badge.svg)](https://github.com/bob-moore/enable-button-icons/actions/workflows/lint-css.yml)[![Lint JS](https://github.com/bob-moore/enable-button-icons/actions/workflows/lint-js.yml/badge.svg)](https://github.com/bob-moore/enable-button-icons/actions/workflows/lint-js.yml)[![Lint PHP](https://github.com/bob-moore/enable-button-icons/actions/workflows/lint-php.yml/badge.svg)](https://github.com/bob-moore/enable-button-icons/actions/workflows/lint-php.yml)

Want to give it a test drive? Try it in the WP Playground: [![Try it in the WordPress Playground](https://camo.githubusercontent.com/75135f4ca69f4b599a073bd0950f724ed8a0890997bfca6a669729d945f8cb1f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f57505f506c617967726f756e642d76302e332e322d626c75653f6c6f676f3d776f72647072657373266c6f676f436f6c6f723d253233666666266c6162656c436f6c6f723d25323333383538653926636f6c6f723d253233333835386539)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/bob-moore/enable-button-icons/main/_playground/blueprint-github.json)

Add icons to the WordPress Button block (`core/button`) in both the editor and frontend.

Fork Notice
-----------

[](#fork-notice)

This plugin is a fork and rewrite of Nick Diego's original project:

This version modernizes the architecture, packaging, and update flow while keeping the plugin focused on one job: adding icons to button blocks.

Features
--------

[](#features)

- Adds icon controls to `core/button` in the block inspector.
- Supports icon libraries:
    - WordPress icons
    - MUI icons
    - MUI variant families, including Outlined, Rounded, and Sharp
    - Custom SVG input
- Lets you set icon position (left/right).
- Lets you set icon size per button using CSS units (for example `1em`, `20px`, `1.25rem`).
- Renders sanitized inline SVG on the frontend.
- Ships with GitHub-based plugin updates in the WordPress admin update UI.

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

[](#requirements)

- WordPress 6.9+
- PHP 8.2+

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

[](#installation)

### Install as a plugin

[](#install-as-a-plugin)

1. Download the latest release zip from GitHub releases.
2. In WordPress admin, go to Plugins -&gt; Add New Plugin -&gt; Upload Plugin.
3. Upload the zip and activate Enable Button Icons.

### Install via Composer (library usage)

[](#install-via-composer-library-usage)

If you are embedding this into your own project:

```
composer require bmd/enable-button-icons
```

Then bootstrap:

```
use Bmd\EnableButtonIcons\Plugin;

$dependency_url  = plugin_dir_url( __FILE__ ) . 'vendor/bmd/enable-button-icons/';
$dependency_path = plugin_dir_path( __FILE__ ) . 'vendor/bmd/enable-button-icons/';

$plugin = new Plugin(
    $dependency_url,
    $dependency_path
);

$plugin->mount();
```

The `Plugin` constructor expects the URL and filesystem path to the Enable Button Icons dependency root, not the file where you call it. For example, pass `/path/to/vendor/bmd/enable-button-icons/` and the matching public URL for that directory.

Usage
-----

[](#usage)

1. Add a Button block.
2. Open the block sidebar.
3. Open the Icon panel.
4. Choose an icon source (WordPress, MUI, or Custom SVG).
5. Pick icon size and position.
6. Save and view the post.

Custom Icon Families
--------------------

[](#custom-icon-families)

Developers can add static JSON icon families with the `enable_button_icons_icon_families` filter. Each JSON file should contain an array of picker-compatible icon objects with `name`, `label`, and `source` properties.

```
add_filter( 'enable_button_icons_icon_families', function ( $families ) {
    $families['brand-icons'] = array(
        'label' => 'Brand Icons',
        'url'   => plugin_dir_url( __FILE__ ) . 'icons/brand-icons.json',
    );

    return $families;
} );
```

Updates
-------

[](#updates)

This plugin is distributed through GitHub releases (not WordPress.org). The plugin includes a scoped GitHub updater so WordPress can detect and apply new versions from this repository.

Changelog
---------

[](#changelog)

### 0.3.2

[](#032)

- Refined the PHP plugin architecture around a dedicated bootstrapper, plugin service, and utility helper.
- Updated Composer autoloading for the new `Bmd\EnableButtonIcons` namespace structure.
- Added and completed PHP file comments and method documentation.
- Updated plugin banner artwork.
- Rebuilt scoped updater dependencies.
- Removed source icon packages from normal development dependencies now that icon data is generated.

### 0.3.1

[](#031)

- Added icon toggle deselection — clicking the currently selected icon removes it.
- Split editor sidebar into separate "Icon" and "Icon Styles" panels.
- Improved icon size control layout with a consistent label and grid alignment.
- Fixed null safety for custom SVG icon input field.
- Fixed block list rendering to skip when icon has no source.
- Updated `IconValue` TypeScript types to allow nullable fields.
- Removed unused `classnames` dependency.

### 0.3.0

[](#030)

- Forked and rewritten from the original `ndiego/enable-button-icons` project.
- Added service-based plugin architecture.
- Added scoped GitHub updater bootstrap.
- Added modern build and release packaging workflow.
- Added icon controls for WordPress, MUI, and custom SVG.
- Added frontend icon rendering with sanitization and per-button sizing/position.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance86

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60% 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 ~8 days

Total

3

Last Release

74d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/adf6af151397e0b108508ed9a8554fa09dc00f90864873446e76fa5b17463e23?d=identicon)[bobjutsu](/maintainers/bobjutsu)

---

Top Contributors

[![ndiego](https://avatars.githubusercontent.com/u/4832319?v=4)](https://github.com/ndiego "ndiego (21 commits)")[![bob-moore](https://avatars.githubusercontent.com/u/1745619?v=4)](https://github.com/bob-moore "bob-moore (13 commits)")[![michaelbragg](https://avatars.githubusercontent.com/u/1015212?v=4)](https://github.com/michaelbragg "michaelbragg (1 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bmd-enable-button-icons/health.svg)

```
[![Health](https://phpackages.com/badges/bmd-enable-button-icons/health.svg)](https://phpackages.com/packages/bmd-enable-button-icons)
```

###  Alternatives

[jord-jd/array_undot

array\_undot (the opposite of the array\_dot helper function) expands a dot notation array into a full multi-dimensional array.

241.3k2](/packages/jord-jd-array-undot)

PHPackages © 2026

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