Templates and snippets
Every template and snippet in the Easy SVG dev setup: what it is for, when to take it, the switch it needs and the command that starts it.
The Easy SVG dev setup is a free GitHub repository with code to copy into client work. Every hook, function and command in it exists in Easy SVG 5.0 and Easy SVG Pro 1.0. tools/check-hooks.php proves it again for the versions you run. License: GPL-2.0-or-later.
Get the code
Three ways, pick the one that fits.
curl -sL https://github.com/unleash-wp/easy-svg-dev-setup/archive/refs/heads/main.tar.gz \
| tar -xz --strip-components=2 easy-svg-dev-setup-main/templates/icon-pack-plugin
You get the folder icon-pack-plugin/ and nothing else. Replace the last part with any folder under templates/.
curl -sO https://raw.githubusercontent.com/unleash-wp/easy-svg-dev-setup/main/snippets/free/filter-icon-markup.php
Good for a snippet. Every .php snippet except render-an-icon.php starts with a plugin header, so it runs as a file in wp-content/mu-plugins/.
git clone https://github.com/unleash-wp/easy-svg-dev-setup.git
Or download the ZIP of the whole repository. You also get the pack checker and the tests.
Before you ship: rename the acme prefix and the text domain to your own. The switches named below are under Easy SVG → Settings → Features.
Templates
Each template renders through easy_svg_icon() from the free plugin. A page keeps its icons when Pro is deactivated, as long as they come from the free library.
Icon pack plugin
A plugin that carries your icons. Each folder under icons/ is one collection, named by its manifest.json. This is the same layout Pro writes when it exports collections as a plugin.
Take it when you hand the same icons to several sites, or want them in Git and Composer. Switch: Collections.
curl -sL https://github.com/unleash-wp/easy-svg-dev-setup/archive/refs/heads/main.tar.gz \
| tar -xz --strip-components=2 easy-svg-dev-setup-main/templates/icon-pack-plugin
Open the template, then read the manifest and Build your pack.
Theme
assets/icons/ with three icons and a manifest.json, plus functions-easy-svg.php with a helper acme_theme_icon() and a second folder registered from code. With Pro, the theme folder is read by itself, child theme over parent.
Take it when the icons belong to one theme. Switch: Collections (the free plugin alone prints only its own library).
curl -sL https://github.com/unleash-wp/easy-svg-dev-setup/archive/refs/heads/main.tar.gz \
| tar -xz --strip-components=2 easy-svg-dev-setup-main/templates/theme
Copy assets/icons/ into your theme and require_once the PHP file from functions.php. Open the template.
PHP-only block
A block written in PHP only, with an icon picker in its sidebar. WordPress draws the sidebar from the attributes; Pro turns the attribute marked 'unleashwp' => array( 'component' => 'icon' ) into a picker.
Take it when you want a block without JavaScript or a build step. Switch: PHP-only blocks.
curl -sO https://raw.githubusercontent.com/unleash-wp/easy-svg-dev-setup/main/templates/php-only-block/acme-feature-block.php
Open the template and the guide PHP-only blocks.
JavaScript block
The block acme/badge: IconControl in the sidebar, IconToolbarButton in the toolbar, both from window.EasySvgPro. Plain script, no build. Without Pro the sidebar falls back to a text field.
Take it when your block needs JavaScript and you do not want a build. Switch: PHP-only blocks (it covers JavaScript blocks too).
curl -sL https://github.com/unleash-wp/easy-svg-dev-setup/archive/refs/heads/main.tar.gz \
| tar -xz --strip-components=2 easy-svg-dev-setup-main/templates/javascript-block
Open the template and the guide JavaScript blocks.
JavaScript block in JSX
The same block with block.json, render.php and @wordpress/scripts. It imports from @unleash-wp/easy-svg-pro; webpack.config.js maps that import to Pro's script on the page, like @wordpress/components maps to wp.components. Nothing is downloaded from npm for it. easy-svg-pro.d.ts gives your editor autocomplete. The built build/ folder is committed, so it runs as it is.
Take it when your blocks use JSX and block.json. Switch: PHP-only blocks.
curl -sL https://github.com/unleash-wp/easy-svg-dev-setup/archive/refs/heads/main.tar.gz \
| tar -xz --strip-components=2 easy-svg-dev-setup-main/templates/javascript-block-jsx
cd javascript-block-jsx && npm install && npm run build
ACF and Secure Custom Fields
A field group with ACF's own Icon Picker field and the tab easy_svg, plus acme_acf_icon() that prints the stored value under either return format. Needs ACF 6.3 or newer.
Take it when a client edits icons in ACF fields. Switch: ACF (or Secure Custom Fields).
curl -sO https://raw.githubusercontent.com/unleash-wp/easy-svg-dev-setup/main/templates/acf/acf-icon-field.php
Meta Box
A meta box with a field of type easy_svg_icon. The field stores the icon address as plain post meta. The file shows both readers: rwmb_meta() gives the address, rwmb_the_value() prints the icon.
Take it when the site uses Meta Box. Switch: Meta Box.
curl -sO https://raw.githubusercontent.com/unleash-wp/easy-svg-dev-setup/main/templates/metabox/metabox-icon-field.php
Elementor
A widget of your own with a normal Controls_Manager::ICONS control. Nothing in it is Easy SVG specific: with the switch on, every icon control gets one tab per collection, and Icons_Manager::render_icon() prints the inline SVG. Two files, because the widget class may load only once Elementor is there.
Take it when you build Elementor widgets. Switch: Elementor.
curl -sL https://github.com/unleash-wp/easy-svg-dev-setup/archive/refs/heads/main.tar.gz \
| tar -xz --strip-components=2 easy-svg-dev-setup-main/templates/elementor
WPBakery
An element of your own with a param of type easy_svg_icon, and the shortcode that draws it. The shortcode is registered even with the switch off, so a saved page never prints its tag as text.
Take it when the site is built with WPBakery. Switch: WPBakery.
curl -sO https://raw.githubusercontent.com/unleash-wp/easy-svg-dev-setup/main/templates/wpbakery/wpbakery-icon-element.php
Snippets for Easy SVG (free)
One file per hook or function. Get any of them with curl -sO https://raw.githubusercontent.com/unleash-wp/easy-svg-dev-setup/main/ followed by the path in the first column, then put it into wp-content/mu-plugins/.
| File | What it does | Take it when |
|---|---|---|
snippets/free/render-an-icon.php | Every argument of easy_svg_icon(): label, size, class, decorative | You print icons in templates. Template code, no plugin header |
snippets/free/filter-icon-markup.php | Adds a class to every library icon, and serves a collection acme/<slug> from a theme folder without Pro | You change icons on their way out |
snippets/free/filter-registrable-icons.php | Hides every icon whose slug starts with wip- from the Icon block | You decide what the Icon block offers |
snippets/free/sanitizer-allow-list.php | Allows feDropShadow and one more attribute; remote references only behind a constant | An icon set needs an element the sanitizer drops |
snippets/free/upload-limits.php | Raises the size limit to 5 MB and the use limit to 2000 | A site uploads large drawings |
snippets/free/write-stored-icons.php | New drawing and new name for a stored icon, without wp_update_post() | You change library icons from code |
snippets/free/addon-sanitizer.php | Cleans SVG with the site's own sanitizer and limits | Your plugin accepts SVG from users |
snippets/free/panel-extension.php | A tab and a script of your own in the Easy SVG screens | You build an add-on for the admin screens |
Snippets for Easy SVG Pro
| File | What it does | Take it when |
|---|---|---|
snippets/pro/register-collection.php | A collection from a folder, and one from inline markup | Icons live in your code, not in a pack |
snippets/pro/source-folders.php | Adds a folder, raises the icon and file limits, renames the theme collection | You load folders from outside the theme |
snippets/pro/registered-icon.php | Thinner strokes for one collection in the Icon block | You change what the Icon block draws for Pro collections |
snippets/pro/icon-set-events.php | Runs code before and after every save of an icon set | A cache or deploy needs to know a set changed |
snippets/pro/import-and-configurator.php | Raises the ZIP and font import limits; refuses one more tag in the configurator | Imports are bigger than the defaults |
snippets/pro/abilities.php | Calls the ability easy-svg-pro/list-icons from PHP | Your code or an AI agent searches icons |
snippets/pro/abilities.md | Every ability with its HTTP method, and which switch it needs | You connect an AI client |
snippets/pro/wp-cli.md | Every wp easy-svg command with its output | You script deploys or CI |
Guides and tools in the repository
| Path | What it is |
|---|---|
docs/icon-packs.md | The manifest, a security checklist for packs you share, and the license rules for other people's icons |
docs/rollout.md | One pack, Easy SVG and Pro on many client sites with Composer, wp-config.php and WP-CLI aliases |
tools/check-pack.php | Checks a pack folder without WordPress: scripts, external references, entities, size, names, license fields |
tools/build-pack.sh | Checks every folder of a pack plugin and only then writes the ZIP |
tools/check-hooks.php | Reads the plugins' source and fails when a snippet names a hook, function or constant that is not there |
php tools/check-pack.php templates/icon-pack-plugin/icons/starter-shapes
bash tools/build-pack.sh templates/icon-pack-plugin dist
build-pack.sh prints the path of the ZIP it wrote, here dist/acme-icons.zip.