Skip to content

Instantly share code, notes, and snippets.

@tribulant
Created August 1, 2014 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tribulant/e3074e475a137ac53096 to your computer and use it in GitHub Desktop.
Save tribulant/e3074e475a137ac53096 to your computer and use it in GitHub Desktop.
Checkout: Filter - checkout_image_attributes Example
<?php
// $attributes = apply_filters('checkout_image_attributes', false, $image, $width, $height, $class);
function attributes($attributes = array(), $image = null, $width = null, $height = null, $class = null) {
$attributes['data-foo'] = "foo-value"; // <img data-foo="foo-value" />
$attributes['rel'] = "overlaybox"; // <img rel="overlaybox" />
}
add_filter('checkout_image_attributes', 'attributes', 10, 5);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment