Created
June 14, 2012 11:50
-
-
Save pdewouters/2929833 to your computer and use it in GitHub Desktop.
add sencha.io to image tag and remove width/height 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( 'get_image_tag', 'secundo_get_image_tag', 10 ); | |
add_filter( 'image_send_to_editor', 'secundo_get_image_tag', 10 ); | |
// Genesis framework only | |
add_filter( 'genesis_get_image', 'secundo_get_image_tag', 10 ); | |
function secundo_get_image_tag( $html, $id, $alt, $title, $align, $size ) { | |
list( $img_src, $width, $height ) = image_downsize( $id, $size ); | |
$class = 'align' . esc_attr( $align ) . ' size-' . esc_attr( $size ) . ' wp-image-' . $id; | |
$class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size ); | |
$html = '<img src="http://src.sencha.io/' . esc_attr( $img_src ) . '" alt="' . esc_attr( $alt ) . '" title="' . esc_attr( $title ) . '" class="' . $class . '" />'; | |
return $html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment