Skip to content

Commit

Permalink
feat(filter): added filter to set tag type globally
Browse files Browse the repository at this point in the history
  • Loading branch information
therajumandapati committed Dec 10, 2018
1 parent cc6c5b8 commit bd3fe67
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions just-rwd-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, $attr = array() ) {
if(empty($tag)) {
$tag = apply_filters( 'rwd_tag_type', 'picture' );
}
echo get_rwd_attachment_image( $attachment, $size, $tag, $attr );
}

Expand All @@ -41,9 +44,8 @@ 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, $attr = array() ) {
$rwd_image = new RwdImage( $attachment );

$size = apply_filters( 'post_thumbnail_size', $size );

if ( 'img' != $tag ) {
Expand Down

0 comments on commit bd3fe67

Please sign in to comment.