Skip to content

Instantly share code, notes, and snippets.

@seojacky
Created July 31, 2020 04:30
Show Gist options
  • Save seojacky/e3bba496ba3bb9cff664809f439e0168 to your computer and use it in GitHub Desktop.
Save seojacky/e3bba496ba3bb9cff664809f439e0168 to your computer and use it in GitHub Desktop.
Custom LOGO attributes
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