Escape the value of get_the_title() when printed in an attribute.

This commit is contained in:
Michael Fields 2012-12-31 16:57:14 -08:00
parent f0c910f5e2
commit d64b796669
1 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,8 @@
*/
get_header();
remove_filter( 'the_title', 'wptexturize' );
?>
<div id="primary" class="content-area image-attachment">
@ -21,13 +23,14 @@ get_header();
<div class="entry-meta">
<?php
$metadata = wp_get_attachment_metadata();
printf( __( 'Published <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>', '_s' ),
printf( __( 'Published <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>', '_s' ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
wp_get_attachment_url(),
$metadata['width'],
$metadata['height'],
get_permalink( $post->post_parent ),
esc_attr( get_the_title( $post->post_parent ) ),
get_the_title( $post->post_parent )
);
?>