Replace `'echo=0'` with `array( 'echo' => false )` and remove duplicate function

This commit is contained in:
Thomas Guillot 2017-10-30 10:57:58 +00:00
parent ce47408461
commit 2a1a954b98
1 changed files with 1 additions and 34 deletions

View File

@ -125,40 +125,7 @@ function _s_post_thumbnail() {
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true"> <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true">
<?php <?php
the_post_thumbnail( 'post-thumbnail', array( the_post_thumbnail( 'post-thumbnail', array(
'alt' => the_title_attribute( 'echo=0' ), 'alt' => the_title_attribute( array( 'echo' => false ) ),
) );
?>
</a>
<?php endif; // End is_singular().
}
endif;
if ( ! function_exists( '_s_post_thumbnail' ) ) :
/**
* Displays an optional post thumbnail.
*
* Wraps the post thumbnail in an anchor element on index views, or a div
* element when on single views.
*/
function _s_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) :
?>
<div class="post-thumbnail">
<?php the_post_thumbnail(); ?>
</div><!-- .post-thumbnail -->
<?php else : ?>
<a class="post-thumbnail" href="<?php the_permalink(); ?>">
<?php
the_post_thumbnail( 'post-thumbnail', array(
'alt' => the_title_attribute( 'echo=0' ),
) ); ) );
?> ?>
</a> </a>