clarify comments, esc_url

This commit is contained in:
Robin Cornett
2015-02-13 17:03:32 -05:00
parent c473bc13ff
commit f9dfc8e1b8
2 changed files with 14 additions and 12 deletions
@@ -138,6 +138,7 @@ class Display_Featured_Image_Genesis_Output {
wp_localize_script( 'displayfeaturedimage-backstretch-set', 'BackStretchVars', $output );
// if titles will be moved to overlay backstretch image
if ( ! $keep_titles ) {
if ( is_singular() && ! is_front_page() && ! is_page_template( 'page_blog.php' ) ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); // HTML5
@@ -172,6 +173,7 @@ class Display_Featured_Image_Genesis_Output {
}
// if titles are not being moved to overlay the image
elseif ( ! $keep_titles ) {
if ( ! empty( $item->title ) && ! is_front_page() ) {
@@ -33,14 +33,14 @@ class Display_Featured_Image_Genesis_Widget_Taxonomy extends WP_Widget {
function __construct() {
$this->defaults = array(
'title' => '',
'taxonomy' => 'category',
'term' => 'none',
'show_image' => 0,
'image_alignment' => '',
'image_size' => 'medium',
'show_title' => 0,
'show_content' => 0
'title' => '',
'taxonomy' => 'category',
'term' => 'none',
'show_image' => 0,
'image_alignment' => '',
'image_size' => 'medium',
'show_title' => 0,
'show_content' => 0
);
$widget_ops = array(
@@ -99,11 +99,11 @@ class Display_Featured_Image_Genesis_Widget_Taxonomy extends WP_Widget {
$image_id = Display_Featured_Image_Genesis_Common::get_image_id( $term_meta['term_image'] );
$image_src = wp_get_attachment_image_src( $image_id, $instance['image_size'] );
if ( $image_src ) {
$image = '<img src="' . $image_src[0] . '" title="' . $title . '" />';
$image = '<img src="' . esc_url( $image_src[0] ) . '" title="' . $title . '" />';
}
if ( $instance['show_image'] && $image ) {
printf( '<a href="%s" title="%s" class="%s">%s</a>', $permalink, esc_html( $title ), esc_attr( $instance['image_alignment'] ), $image );
printf( '<a href="%s" title="%s" class="%s">%s</a>', esc_url( $permalink ), esc_html( $title ), esc_attr( $instance['image_alignment'] ), $image );
}
}
@@ -112,9 +112,9 @@ class Display_Featured_Image_Genesis_Widget_Taxonomy extends WP_Widget {
if ( ! empty( $instance['show_title'] ) ) {
if ( genesis_html5() )
printf( '<h2 class="archive-title"><a href="%s">%s</a></h2>', $permalink, esc_html( $title ) );
printf( '<h2 class="archive-title"><a href="%s">%s</a></h2>', esc_url( $permalink ), esc_html( $title ) );
else
printf( '<h2><a href="%s">%s</a></h2>', $permalink, esc_html( $title ) );
printf( '<h2><a href="%s">%s</a></h2>', esc_url( $permalink ), esc_html( $title ) );
}