Blog

Stay connected to the latest UpdraftPlus news.

Description

Use this filter to modify or add attributes to each slide anchor (link) tag.

{type} can be flex, coin, responsive or nivo.

Parameters

$attributes

(array) (required) Default anchor attributes (eg url, target etc).

$slide

(array) (required) Slide data

$slider_id

(int) (required) Slideshow ID

Examples

This example will automatically link each slide to it’s full image URL. {type} can be flex, coin, responsive or nivo.

function metaslider_add_full_url_to_slides($attributes, $slide, $slider_id) {
	if (!strlen($attributes['href'])) {
		$attributes['href'] = wp_get_attachment_url($slide['id']);
	}
	return $attributes;
}
add_filter('metaslider_flex_slider_anchor_attributes', 'metaslider_add_full_url_to_slides', 10, 3);