Icons paneleasy_svg_panel_pro_logo

easy_svg_panel_pro_logo

Show an add-on's own logo in the header of the Easy SVG Icons panel instead of the Easy SVG logo.

Filter · Easy SVG · Status: Stable

The Icons panel shows the Easy SVG logo in its header. This filter hands the panel the address of another logo. When it returns a URL, the header shows that image instead of the Easy SVG logo and its Pro badge.

Usage

apply_filters( 'easy_svg_panel_pro_logo', string $url )

Applied in includes/panel.php, inside easy_svg_panel_assets(), when the Icons screen loads. The result reaches the panel as window.EasySvgPanelData.proLogo.

Quick check

Put this in a mu-plugin (a PHP file in wp-content/mu-plugins, which WordPress always loads) and open Easy SVG → Icons: the header shows the WordPress logo.

<?php
add_filter( 'easy_svg_panel_pro_logo', function () {
	return includes_url( 'images/w-logo-blue.png' );
} );

When to use it

  • Your add-on extends the Icons panel and should carry its own brand in the header.

Do not use it when:

  • You want to change the small square mark on narrow screens. That mark stays the plugin's own.
  • You want to change the buy link. That is easy_svg_pro_url.

Parameters

body
$urlstring
Required

The current logo address. Empty by default.

Return value

returnstring

The address of an image, or an empty string to keep the Easy SVG logo. The value is cast to a string and passed through esc_url_raw(), so an address with a protocol WordPress does not allow ends up empty.

Default

'': the header shows the Easy SVG logo, plus a Pro badge while Easy SVG Pro is active.

Examples

function myaddon_panel_logo( $url ) {
	return plugins_url( 'assets/logo.svg', __FILE__ );
}
add_filter( 'easy_svg_panel_pro_logo', 'myaddon_panel_logo' );

Defensive: keep a logo another add-on set

function myaddon_panel_logo_if_free( $url ) {
	if ( '' !== $url ) {
		return $url;
	}
	return plugins_url( 'assets/logo.svg', __FILE__ );
}
add_filter( 'easy_svg_panel_pro_logo', 'myaddon_panel_logo_if_free', 20 );

How it works

  1. easy_svg_panel_assets() runs on the Icons screen and applies the filter with an empty string.
  2. The result goes through esc_url_raw() and into EasySvgPanelData.proLogo.
  3. The header draws proLogo when it is set, 2.5rem high with its own width, from the small breakpoint up. Without it, the header draws the Easy SVG logo and, while Pro is active, a Pro badge.

Pitfalls

  • The alt text says "Easy SVG Pro". The panel sets that alt text on any logo that comes through this filter. Use it for a logo that belongs with Easy SVG Pro.
  • Only the wide header changes. On narrow screens the panel shows its compact mark either way.
  • Easy SVG Pro uses this filter too. Its own logo comes through it, so an add-on running beside Pro decides by priority which logo wins.