Docs

Action & Filter HooksUpdated

4 min readUpdated November 10, 2026

WP LinkCanvas offers filters to change its behaviour without editing plugin files. All start with nlb_. Add them in a small plugin or your child theme’s functions.php.

Icons#

nlb_icons#

Filters the icon list used for social icons and link icons.

Parameters: $icons (array) Returns: array

Each entry needs label, group and svg (inline SVG markup). Use fill="currentColor" or stroke="currentColor" so the icon takes the theme’s colour. The groups are generic, social, messaging, video, music, creator, shopping, creative, gaming and other; any other group is listed last in the icon picker. An optional aliases string adds other names to the picker’s search.

add_filter( 'nlb_icons', function ( $icons ) {
	$icons['my-platform'] = array(
		'label'   => 'My Platform',
		'group'   => 'social',
		'aliases' => 'MyPlat',
		'svg'     => '<svg viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="10"/></svg>',
	);
	return $icons;
} );

Since 1.0.8 the icons are SVG and Font Awesome is no longer loaded. Entries that only have a Font Awesome fa class are skipped; give them an svg instead. The nlb_fontawesome_base_url filter was removed.

nlb_allow_svg_upload#

Whether the current user may upload SVG files, which WP LinkCanvas cleans on upload. Default: users who can upload files. See Custom SVG Icons.

Parameters: $allowed (bool) Returns: bool

// Keep WordPress's default: no SVG uploads.
add_filter( 'nlb_allow_svg_upload', '__return_false' );

SEO#

nlb_seo_title#

The SEO title of a bio page, after the language tab’s value is read.

Parameters: $title (string, empty when not set), $post_id (int), $lang_code (string) Returns: string

add_filter( 'nlb_seo_title', function ( $title, $post_id, $lang_code ) {
	return $title ? $title : get_the_title( $post_id ) . ' | My Site';
}, 10, 3 );

nlb_seo_description#

The meta description. Same parameters as nlb_seo_title.

nlb_seo_image#

The social share image URL. Falls back to the profile photo when the language tab has none.

Parameters: $image (string), $post_id (int), $lang_code (string) Returns: string

Countries#

nlb_detect_country#

The detected country code, after all detection methods ran.

Parameters: $code (string, two letters such as AE, or empty) Returns: string

// Pretend every visitor is in the UAE while testing.
add_filter( 'nlb_detect_country', function ( $code ) {
	return 'AE';
} );

nlb_country_fallback#

The text used for {country} when no country is found. Empty by default.

Parameters: $fallback (string), $lang_code (string) Returns: string

add_filter( 'nlb_country_fallback', function ( $fallback, $lang_code ) {
	return 'ar' === $lang_code ? 'بلدك' : 'your country';
}, 10, 2 );

nlb_country_name#

The name shown for a country code in a given language.

Parameters: $name (string), $code (string), $lang_code (string) Returns: string

nlb_trusted_proxies#

IP addresses of proxies allowed to pass on the visitor’s IP in the X-Forwarded-For or CF-Connecting-IP header, for geo lookups through freeipapi.com or IP2Location.io. Proxies on a private or local address are trusted without this filter. Sites using the Cloudflare or Bunny.net country header do not need it.

Parameters: $proxies (string[], exact IP addresses, empty by default) Returns: string[]

add_filter( 'nlb_trusted_proxies', function ( $proxies ) {
	$proxies[] = '203.0.113.10'; // Your load balancer.
	return $proxies;
} );

Embeds#

nlb_embed_providers#

The list of platforms for Generate from URL. Each entry needs at least name and patterns (regular expressions).

add_filter( 'nlb_embed_providers', function ( $providers ) {
	$providers['my-platform'] = array(
		'name'     => 'My Platform',
		'patterns' => array( '#myplatform\.com/video/([0-9]+)#i' ),
		'embed'    => 'https://myplatform.com/embed/{id}',
	);
	return $providers;
} );

nlb_embed_data#

The auto-fill result for a pasted URL: title, thumbnail, embed_html, subtitle and provider.

Parameters: $data (array), $url (string) Returns: array

nlb_embed_iframe_allowed_hosts#

Hosts whose iframes survive cleaning when a link is saved. Subdomains are included automatically.

Parameters: $hosts (array) Returns: array

add_filter( 'nlb_embed_iframe_allowed_hosts', function ( $hosts ) {
	$hosts[] = 'player.mycdn.com';
	return $hosts;
} );

Media player#

The hosts added to Must-Have Cookie’s essential hosts when Always allow YouTube and Vimeo is chosen.

Parameters: $hosts (string[]) Returns: string[]

The HTML of the Must-Have Cookie buttons shown on a blocked YouTube or Vimeo player, after the shortcodes from Consent buttons have been rendered.

Parameters: $html (string) Returns: string

Themes#

nlb_theme_presets#

The theme presets shown in the editor. Each needs label, sample (colours for the swatch) and tokens. The simplest way is to copy an existing preset and change its values.

add_filter( 'nlb_theme_presets', function ( $presets ) {
	$presets['ocean']          = $presets['midnight'];
	$presets['ocean']['label'] = 'Ocean';
	$presets['ocean']['tokens']['accent']  = '#00b4d8';
	$presets['ocean']['tokens']['page-bg'] = '#03045e';
	return $presets;
} );

Template override#

To replace the bio page template, copy templates/bio-page.php from the plugin to your-theme/wp-link-canvas/bio-page.php and edit the copy. The older your-theme/nahnu-link-bio/bio-page.php path also works.

Copy the template again after updates that change it. Version 1.0.7 changed the media player markup for Video.js, so an override copied from an earlier version shows broken players.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only