Permalink
Browse files

The hybrid_*_attributes functions should allow for attributes without…

… values and output them properly.
  • Loading branch information...
1 parent 483bb2d commit 7282237e6102e280abda2aa4e55f213ce9b208b3 @justintadlock committed Oct 1, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 functions/context.php
View
@@ -143,7 +143,7 @@ function hybrid_body_attributes() {
$attributes = apply_atomic( 'body_attributes', $attributes );
foreach( $attributes as $attr => $value )
- $output .= " {$attr}='{$value}'";
+ $output .= !empty( $value ) ? " {$attr}='{$value}'" : " {$attr}";
echo $output;
}
@@ -268,7 +268,7 @@ function hybrid_post_attributes() {
$attributes = apply_atomic( 'post_attributes', $attributes );
foreach( $attributes as $attr => $value )
- $output .= " {$attr}='{$value}'";
+ $output .= !empty( $value ) ? " {$attr}='{$value}'" : " {$attr}";
echo $output;
}
@@ -411,7 +411,7 @@ function hybrid_comment_attributes() {
$attributes = apply_atomic( 'comment_attributes', $attributes );
foreach( $attributes as $attr => $value )
- $output .= " {$attr}='{$value}'";
+ $output .= !empty( $value ) ? " {$attr}='{$value}'" : " {$attr}";
echo $output;
}

0 comments on commit 7282237

Please sign in to comment.