Forked from n7studios/soliloquy-output-custom-slider-attributes.php
Last active
August 29, 2015 14:13
-
-
Save ericakfranz/2b0a2c72c41d08d524ac to your computer and use it in GitHub Desktop.
Add custom Slider Item attributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Soliloquy - Output Custom Slider Item Attributes | |
* Plugin URI: http://soliloquywp.com | |
* Version: 1.0 | |
* Author: Tim Carr | |
* Author URI: http://www.n7studios.co.uk | |
* Description: Add custom HTML attributes to Soliloquy Slider <img> elements | |
*/ | |
/** | |
* @param string $attributes Image HTML attributes | |
* @param int|string $id The ID for the slide. | |
* @param array $item Array of data for the slide. | |
* @param array $data Array of data for the slider. | |
* @param int $i The number of the slide in the slider. | |
* @return string Image HTML attributes | |
*/ | |
function soliloquy_output_custom_slider_attributes( $attributes, $id, $item, $data, $i ) { | |
$attributes .= ' crossorigin="anonymous"'; // Change this to the attributes you want to add | |
return $attributes; | |
} | |
add_filter( 'soliloquy_output_image_attr', 'soliloquy_output_custom_slider_attributes', 10, 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment