Admineasy_svg_pro_url

easy_svg_pro_url

Change where the Buy Easy SVG Pro link in the plugin's row on the Plugins screen points to, for example to a partner page or a referral link.

Filter · Easy SVG · Status: Stable

On the Plugins screen, the Easy SVG row shows a red "Buy Easy SVG Pro" link next to Deactivate as long as the paid add-on is not installed. This filter changes the address that link opens. It does not change the text, and it cannot hide the link.

Usage

apply_filters( 'easy_svg_pro_url', string $url )

Applied in includes/panel.php, inside easy_svg_plugin_action_links(). Since 5.4.0.

When to use it

  • You are an agency or reseller and want the link to go to your own page about the add-on, or to a referral link.
  • You add tracking parameters (for example UTM values) so you can see where purchases come from.

Do not use it when:

  • You want the link gone. This filter only changes the target. Remove the easy_svg_pro entry from the action links instead (see the examples).
  • You want to change the "Icons" link next to it. That one always points to the Icons screen.

Parameters

body
$urlstring
Required

The current target. By default the value of the constant EASY_SVG_PRO_URL, which is https://www.unleash-wp.com.

Return value

returnstring

The address the link should open. It is cast to a string and passed through esc_url() before it is printed, so addresses with a protocol WordPress does not allow (for example javascript:) end up as an empty href. Return a full https:// URL.

Default

https://www.unleash-wp.com (the constant EASY_SVG_PRO_URL).

Examples

function mysite_easy_svg_pro_url( $url ) {
	return 'https://example.com/easy-svg-pro/';
}
add_filter( 'easy_svg_pro_url', 'mysite_easy_svg_pro_url' );

Keep the default page, add tracking parameters

function mysite_easy_svg_pro_url_tracked( $url ) {
	return add_query_arg(
		array(
			'utm_source'   => 'client-site',
			'utm_medium'   => 'plugins-screen',
			'utm_campaign' => 'easy-svg',
		),
		$url
	);
}
add_filter( 'easy_svg_pro_url', 'mysite_easy_svg_pro_url_tracked' );

add_query_arg() keeps whatever address another filter set and only adds the parameters.

The filter cannot hide the link. Use WordPress's own action link filter for this plugin's row and drop the easy_svg_pro key. The plugin's file is easy-svg/easy-svg.php when the folder has its usual name.

function mysite_remove_easy_svg_pro_link( $links ) {
	unset( $links['easy_svg_pro'] );

	return $links;
}
add_filter( 'plugin_action_links_easy-svg/easy-svg.php', 'mysite_remove_easy_svg_pro_link', 20 );

Priority 20 makes sure Easy SVG has added its links (at the default 10) before yours runs.

How it works

  1. WordPress draws the row of each plugin on the Plugins screen and applies plugin_action_links_easy-svg/easy-svg.php.
  2. Easy SVG's callback easy_svg_plugin_action_links() always adds an "Icons" link to the Icons screen.
  3. Only if Easy SVG Pro is not installed, it also adds the "Buy Easy SVG Pro" link (German: "Easy SVG Pro kaufen"). That function comes with the add-on, so the link disappears as soon as the add-on is active, licensed or not.
  4. The address is esc_url( (string) apply_filters( 'easy_svg_pro_url', EASY_SVG_PRO_URL ) ). The link opens in a new tab with rel="noopener noreferrer".
  5. Both links are placed before WordPress's own links (Deactivate and others).

The filter fires only while that row is being drawn, so it costs nothing on other screens.

Pitfalls

  • Not shown in the network admin. On multisite, the network's Plugins screen uses a different WordPress hook (network_admin_plugin_action_links_...), which Easy SVG does not use. The link and this filter only appear on a site's own Plugins screen.
  • An empty string does not remove the link. It prints a link with an empty target. Use the removal example above.
  • The hook name follows the folder name. If the plugin was installed in a folder other than easy-svg, the action link hook in the removal example is different. This filter's own name never changes.
  • The referrer is not sent. The link carries rel="noreferrer", so the target page does not see which site it came from. Put what you need into query parameters.