Developer guidesPremium theme builders

Premium theme builders

How Easy SVG Pro joins the icon fields of Impreza, Salient, Uncode and Avada: the hooks it uses, the value each theme stores, the CSS it prints, and how to write icons into templates and demo imports.

Impreza, Salient, Uncode and Avada each have their own icon field, and each stores and prints an icon its own way. Easy SVG Pro joins those fields through the theme's own hooks, so the theme's elements keep doing the rendering. This page is the developer view: what is stored, what is printed, and where you can step in.

Try it

On an Avada site, with Avada and Collections switched on and a collection acme that holds an icon phone, put this shortcode on a page:

[fusion_fontawesome icon="fusion-prefix-esvg-av-acme-phone" size="50" /]

What you see: the phone icon at 50 pixels in the theme's icon color. The page source shows an <i> with the class esvg-av-acme-phone, and the stylesheet easy-svg-pro-avada-icons is loaded. The same idea works for the other three themes with the values in the table below.

At a glance

ThemeFeature keyPro hooks intoStored valueOn the page
Impreza (US Core)imprezaus_config_icon-sets, us_icon_tagesvg-<collection>|<slug><i class="esvg-<collection> fa-<slug>"> with the free plugin's <svg> inside
Salient (its WPBakery)salientvc_after_init, vc_iconpicker-type-easy_svg, vc_shortcode_prepare_attsicon_family="easy_svg" and icon_easy_svg="esvg-vc-icon esvg-vc-<collection>-<slug>"<i class="esvg-vc-icon esvg-vc-…">, painted by a CSS mask
Uncode (its WPBakery)uncodevc_iconpicker-type-uncode, vc_shortcode_prepare_attsicon="esvg-vc-icon esvg-vc-<collection>-<slug>"<i class="esvg-vc-icon esvg-vc-…">, painted by a CSS mask
Avada (Avada Builder)avadafusion_custom_icons, fusion_enqueue_live_scripts, do_shortcode_tagicon="fusion-prefix-esvg-av-<collection>-<slug>"<i class="… esvg-av-<collection>-<slug> …">, painted by a CSS mask in its ::before

<collection> and <slug> are the two halves of an icon's address collection/slug, the same address easy_svg_icon() takes.

When each part runs

  • Pickers (the icons offered in the editor) need the feature key on and an active license. Icons switched off in their set are never offered.
  • Rendering needs only the theme. Switch a feature off, or let the license lapse, and published pages keep their icons; only the picker goes away. Icons switched off in their set keep rendering where a page already uses them.
  • Editing requests only: Pro adds its sets to Impreza's and Avada's lists in wp-admin and the theme's own builder frames, never on a visitor's page view, so the inventory is not read for nothing.

Switch the features on centrally with the easy_svg_pro_features option, as in Global settings with per-site overrides.

Impreza

Impreza keeps its icon sets in us_config( 'icon-sets' ) and draws every icon through us_prepare_icon_tag(). Pro adds one set per collection, keyed esvg-<collection> and marked kit, so Impreza writes no @font-face for it and does not list it under Theme Options → Icons. On output, the us_icon_tag filter puts the free plugin's hardened <svg> inside Impreza's <i>. The <i> keeps its classes and the inline style Impreza built from the element's settings.

[us_iconbox icon="esvg-acme|phone" title="Call us"]
[us_btn label="Call us" icon="esvg-acme|phone"]
  • An <svg> without a fill of its own gets fill="currentColor", so it follows the element's color. Icons that color their own shapes keep them.
  • Impreza reads its sets before init, when no collection is registered yet, and caches them. Pro reloads them on init at priority 12 with us_config( 'icon-sets', array(), true ).
  • The editor preview is an empty <i> the theme builds in JavaScript. Pro paints it with a mask sheet scoped to :empty, on usof_print_scripts, usb_enqueue_assets_for_builder and WPBakery's editor hooks.
  • Impreza resets an icon field to its default when it does not know the field's set. If a whole collection is switched off, saving an element that uses it empties the field.

Salient

Salient's elements carry the standard WPBakery icon_fontawesome param behind a dropdown called icon_family, so Pro's WPBakery library joins them: Easy SVG icons in the dropdown and a picker of type easy_svg. Salient's templates switch over the families they know and print an empty icon for any other. Pro therefore hands the value over on vc_shortcode_prepare_atts, at render time only: icon_family becomes fontawesome and icon_fontawesome takes the value of icon_easy_svg. The stored page keeps icon_family="easy_svg".

[nectar_icon icon_family="easy_svg" icon_easy_svg="esvg-vc-icon esvg-vc-acme-phone"]
[nectar_btn text="Call us" icon_family="easy_svg" icon_easy_svg="esvg-vc-icon esvg-vc-acme-phone"]

The same pair works in fancy_box, nectar_icon_list_item, nectar_cta, tab and every other Salient element with an icon. Only values that start with esvg-vc-icon are moved; any other value stays as it is.

Uncode

Uncode's elements use one iconpicker param icon of type uncode. Pro appends its collections as groups to vc_iconpicker-type-uncode at priority 20, after Uncode fills its own list. Uncode prints the stored value straight into the element's class.

[vc_icon icon="esvg-vc-icon esvg-vc-acme-phone"]
[uncode_button icon="esvg-vc-icon esvg-vc-acme-phone" icon_src="picker"]Call us[/uncode_button]

The WPBakery mask sheet (Salient and Uncode)

A WPBakery icon is a CSS class, so Pro paints it with a mask: .esvg-vc-icon gives the box (1em, currentColor), and one rule per icon, .esvg-vc-<collection>-<slug>, names its drawing. The sheet goes out under the handle easy-svg-pro-wpbakery-icons:

  • in the editors, on vc_backend_editor_enqueue_js_css and vc_frontend_editor_enqueue_js_css;
  • on the page, when an element asks for the easy_svg font, or when any element's attributes hold a value starting with esvg-vc-icon (vc_shortcode_prepare_atts). Neither Salient nor Uncode fires vc_enqueue_font_icon_element, so the second way is the one that works there.

A rule .esvg-vc-icon:not(#esvg-keep){background-color:currentColor!important} keeps the paint when a theme clears icon backgrounds with !important, as Salient's Material skin does on buttons.

Avada

Avada lists custom icon sets through fusion_custom_icons, and every picker reads that list. Pro adds one set per collection: key esvg-<collection>, css_prefix esvg-av-<collection>-, the slugs as icons, and an empty icon_set_dir_name and css_url, so Avada neither inlines a style.css nor preloads a font for it. A click in the picker stores fusion-prefix- plus the icon's class; Avada strips the prefix and prints the class on the element's <i>. The class has to be one word: Avada's picker reads a value with a space as Font Awesome.

[fusion_fontawesome icon="fusion-prefix-esvg-av-acme-phone" size="50" /]
[fusion_button link="#" icon="fusion-prefix-esvg-av-acme-phone"]Call us[/fusion_button]

The icon is drawn in the <i>'s ::before, the way an icon font draws its glyph: the icon rule only sets --esvg-mask on the element, and the ::before uses it. Avada paints the Icon element's circle as the <i>'s own background, and a mask on the <i> would cut it away. The sheet goes out under the handle easy-svg-pro-avada-icons:

  • in the Live Builder on fusion_enqueue_live_scripts, and in wp-admin on post.php, post-new.php, nav-menus.php and Avada's own screens;
  • on the page through do_shortcode_tag, as soon as a shortcode's output contains esvg-av-. Every Avada element is a shortcode, layouts and global sections included.

Switching a part off in code

Every hook is added with a plain function name in the namespace Easy_Svg_Pro, so remove_filter() and remove_action() work after plugins_loaded:

// Keep Easy SVG Pro's sets out of Avada's picker on this site.
add_action( 'plugins_loaded', static function (): void {
	remove_filter( 'fusion_custom_icons', 'Easy_Svg_Pro\avada_icon_sets' );
}, 20 );
HookFunction
us_config_icon-setsEasy_Svg_Pro\impreza_icon_sets
us_icon_tagEasy_Svg_Pro\impreza_icon_tag
vc_shortcode_prepare_attsEasy_Svg_Pro\wpbakery_prepare_atts
vc_iconpicker-type-uncodeEasy_Svg_Pro\wpbakery_theme_icons (priority 20)
fusion_custom_iconsEasy_Svg_Pro\avada_icon_sets
do_shortcode_tagEasy_Svg_Pro\avada_shortcode_css

Usually the feature switch is the better tool: it takes the picker away and leaves published pages rendering.

Tested with

Salient 18.4.1 (its WPBakery 9.0.1), Uncode 2.12.9 (its WPBakery 8.7.4.1), Impreza 9.5 (US Core 9.5), Avada 7.15.5 with Avada Builder 3.15.5. Astra is not covered: it has no icon picker for content, and Spectra's uagb_icons_chunks takes a single path per icon.