Created
August 4, 2012 18:20
-
-
Save rolandinsh/3259153 to your computer and use it in GitHub Desktop.
add itemprop to WordPress elements (image attributes)
This file contains 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 | |
/* | |
* @author umbrovskis | |
* @url http://simplemediacode.info/?post_type=snippets&p=920 | |
*/ | |
add_filter('wp_get_attachment_image_attributes', 'ipwp_img_attr', 10, 2); | |
function ipwp_img_attr($attr) { | |
$attr['itemprop'] = 'image'; | |
return $attr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment