diff --git a/just-rwd-functions.php b/just-rwd-functions.php index bd34760..2549b9f 100644 --- a/just-rwd-functions.php +++ b/just-rwd-functions.php @@ -21,7 +21,10 @@ * @param string $tag Specify which tag should be used: picture|img. * @param array $attr Additional html attributes to be used for main tag. */ -function rwd_attachment_image( $attachment = null, $size = 'thumbnail', $tag = 'picture', $attr = array() ) { +function rwd_attachment_image( $attachment = null, $size = 'thumbnail', $tag = null, $attr = array() ) { + if( empty( $tag ) ) { + $tag = apply_filters( 'rwd_tag_type', 'picture' ); + } echo get_rwd_attachment_image( $attachment, $size, $tag, $attr ); } @@ -41,9 +44,13 @@ function rwd_attachment_image( $attachment = null, $size = 'thumbnail', $tag = ' * * @return string Generated html. */ -function get_rwd_attachment_image( $attachment = null, $size = 'thumbnail', $tag = 'picture', $attr = array() ) { +function get_rwd_attachment_image( $attachment = null, $size = 'thumbnail', $tag = null, $attr = array() ) { $rwd_image = new RwdImage( $attachment ); + if( empty( $tag ) ) { + $tag = apply_filters( 'rwd_tag_type', 'picture' ); + } + $size = apply_filters( 'post_thumbnail_size', $size ); if ( 'img' != $tag ) {