Quick StartSnippets and templates in five minutes

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 wantCopySwitch on under Easy SVG → Settings → Features
Your own icon pack plugintemplates/icon-pack-plugin/Collections
Icons in your themetemplates/theme/Collections
An ACF field with your iconstemplates/acf/ACF
A Meta Box fieldtemplates/metabox/Meta Box
An Elementor widgettemplates/elementor/Elementor
A WPBakery elementtemplates/wpbakery/WPBakery
A block written in PHP onlytemplates/php-only-block/PHP-only blocks
A block in plain JavaScript, picker in sidebar and toolbartemplates/javascript-block/PHP-only blocks
The same block in JSX, with block.jsontemplates/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> with role="img" and your label.
  • The snippet shows under Plugins → Must-Use.
  • tools/build-pack.sh prints the path of the ZIP.

Pitfalls

Next