承接 bmd/enable-button-icons 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bmd/enable-button-icons

最新稳定版本:v0.3.2

Composer 安装命令:

composer require bmd/enable-button-icons

包简介

Extension to add icons to Button blocks.

README 文档

README

Enable Button Icons

WordPress PHP Latest Release License

Lint CSS Lint JS Lint PHP

Want to give it a test drive? Try it in the WP Playground: Try it in the WordPress Playground

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

Fork Notice

This plugin is a fork and rewrite of Nick Diego's original project: https://github.com/ndiego/enable-button-icons

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

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

  • WordPress 6.9+
  • PHP 8.2+

Installation

Install as a plugin

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

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

  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

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

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

0.3.2

  • 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

  • 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

  • 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.

统计信息

  • 总下载量: 34
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 35
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-04-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固