Snippets and templates in five minutes
Download the Easy SVG dev setup, print your first icon, drop a hook snippet into mu-plugins and start an icon pack plugin or a builder field from a template.
The Easy SVG dev setup is a free repository of copy-ready code for Easy SVG and Easy SVG Pro: one snippet per hook, and templates for an icon pack plugin, a theme, ACF, Meta Box, Elementor and WPBakery. Every hook and function in it is checked against the plugins' own code.
Download the templates
One ZIP with every snippet and template. Or browse them on GitHub first.
1. Print your first icon
Switch on Manage icons under Easy SVG → Settings → General, then add an icon under Easy SVG → Icons: click Upload and pick a file, for example heart.svg, which becomes the icon heart. Then, in your theme:
if ( function_exists( 'easy_svg_icon' ) ) {
echo easy_svg_icon( 'easy-svg/heart', array( 'label' => __( 'Liked', 'acme' ) ) );
}
Without PHP: [easy_svg_icon name="easy-svg/heart"]. An icon is always addressed as collection/slug; the free library is easy-svg.
2. Drop in a hook snippet
Every .php file under snippets/ except render-an-icon.php carries a plugin header. Copy it into wp-content/mu-plugins/ and it runs:
cp snippets/free/filter-icon-markup.php wp-content/mu-plugins/
Rename the acme prefix and text domain to your own before you ship it.
3. Start from a template
| You want | Copy | Switch on under Easy SVG → Settings → Features |
|---|---|---|
| Your own icon pack plugin | templates/icon-pack-plugin/ | Collections |
| Icons in your theme | templates/theme/ | Collections |
| An ACF field with your icons | templates/acf/ | ACF |
| A Meta Box field | templates/metabox/ | Meta Box |
| An Elementor widget | templates/elementor/ | Elementor |
| A WPBakery element | templates/wpbakery/ | WPBakery |
| A block written in PHP only | templates/php-only-block/ | PHP-only blocks |
| A block in plain JavaScript, picker in sidebar and toolbar | templates/javascript-block/ | PHP-only blocks |
The same block in JSX, with block.json | templates/javascript-block-jsx/ | PHP-only blocks |
Every template renders through easy_svg_icon(), so a page keeps working when Pro is deactivated.
4. Check before you ship
php tools/check-pack.php templates/icon-pack-plugin/icons/starter-shapes
bash tools/build-pack.sh templates/icon-pack-plugin dist
The checker refuses scripts, external references, DTD entities, oversized files and invalid names. The build script runs it on every folder and only then writes the ZIP.
When it worked
- The icon prints as inline
<svg>withrole="img"and your label. - The snippet shows under Plugins → Must-Use.
tools/build-pack.shprints the path of the ZIP.