Created
July 31, 2020 04:30
-
-
Save seojacky/e3bba496ba3bb9cff664809f439e0168 to your computer and use it in GitHub Desktop.
Custom LOGO 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
add_filter( 'wp_get_attachment_image_attributes', 'xxx_attachment_image', 90, 2 ); | |
function xxx_attachment_image( $attr, $attachment ) { | |
$custom_logo_id = get_theme_mod( 'custom_logo' ); | |
if($attachment->ID == $custom_logo_id) { | |
$attr['data-class'] = $custom_logo_id; | |
$attr['data-hey'] = 'hey'; | |
} | |
return $attr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment