boxuk/wp-iconography 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

boxuk/wp-iconography

Composer 安装命令:

composer require boxuk/wp-iconography

包简介

Adds Material Icons to the Block Editor

README 文档

README

Add the ability to add icons inline to your content in the WordPress block editor.

Quick Start!

Add this plugin to your WordPress site and include a configuration file and it's ready to use!

If you're using composer, then it's as simple as composer require boxuk/wp-iconography.

Configuration

Configuration files are based on a schema that allows you to quickly define the configuration. They're loaded automatically from wp-content/themes/{theme_name}/icons/*.config.json, or you can define any custom paths using the filter available:

add_filter(
	'boxuk_iconography_files',
	function ( $config_files ) {
		$config_files['example'] = __DIR__ . '/config/example.config.json';
		return $config_files;
	}
);

There's also example configuration files included in the plugin, so if you want to load Material Symbols you can just load the config included using this snippet:

add_filter(
	'boxuk_iconography_files',
	function ( $config_files ) {
		$plugin_dir = WP_CONTENT_DIR . '/mu-plugins/wp-iconography'; // make sure this is valid for your project!


		// Remove any unnecessary
		$config_files['material-symbols-outlined']        = $plugin_dir . '/config/material-symbols-outlined.config.json';
		$config_files['material-symbols-outlined-filled'] = $plugin_dir . '/config/material-symbols-outlined-filled.config.json';
		$config_files['material-symbols-sharp']           = $plugin_dir . '/config/material-symbols-sharp.config.json';
		$config_files['material-symbols-sharp-filled']    = $plugin_dir . '/config/material-symbols-sharp-filled.config.json';
		$config_files['material-symbols-rounded']         = $plugin_dir . '/config/material-symbols-rounded.config.json';
		$config_files['material-symbols-rounded-filled']  = $plugin_dir . '/config/material-symbols-rounded-filled.config.json';
		return $config_files;
	}
);

There's loads of filters available to change the way icons load, so feel free to look through the source code at the available filters. And if there's function that doesn't work for you, PRs are always welcome!

Configuration Schema

The Schema for configuration includes:

  • Title - the name output in the editor.
  • Name - the unique key/name for the icon set. I'd recommend namespace/name format.
  • Tag Name - this is the HTML tag that will be used to generate the output for the icon.
  • Class Name - this is used to generate the output for the icon
  • URL - the CSS file to load
  • Additional CSS - any inline CSS to include that might be relevant.
  • Icons - an array of:
    • Label - the value to use in the admin interface. Used for searches and is displayed on hover.
    • Content - the content inside the HTML generated.

Sample JSON file:

{
	"title": "Example",
	"name": "boxuk/example",
	"tagName": "span",
	"className": "boxuk-icon-example",
	"url": "...",
	"additionalCSS": ".boxuk-icon-example { font-weight: 700; }",
	"icons": [
		{ "label": "Example", "content": "example-content" }
	]
}

Generated output:

<span class="boxuk-icon-example">example-content</span>

Contributing

Please do not submit any Pull Requests here. They will be closed.

Please submit your PR here instead: https://github.com/boxuk/wp-packages

This repository is what we call a "subtree split": a read-only subset of that main repository. We're looking forward to your PR there!

boxuk/wp-iconography 适用场景与选型建议

boxuk/wp-iconography 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.11k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 07 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 boxuk/wp-iconography 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 boxuk/wp-iconography 我们能提供哪些服务?
定制开发 / 二次开发

基于 boxuk/wp-iconography 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 9.11k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 24
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-07-11