mirror of
https://github.com/10h30/Display-Posts-Shortcode-Remote.git
synced 2026-06-05 15:07:31 +09:00
Support argument image_size="false"
Support argument image_size="false" to disable image
This commit is contained in:
@@ -467,11 +467,13 @@ if ( ! class_exists( 'Display_Posts_Remote' ) ) {
|
|||||||
|
|
||||||
$imageAttributes = $self->getImageAttributes( $atts );
|
$imageAttributes = $self->getImageAttributes( $atts );
|
||||||
|
|
||||||
if ( $atts['image_size'] && $post->has_post_thumbnail() && $atts['include_link'] ) {
|
if( $atts['image_size'] && false !== filter_var( $atts['image_size'], FILTER_VALIDATE_BOOLEAN ) ) {
|
||||||
|
|
||||||
|
if ( $post->has_post_thumbnail() && $atts['include_link'] ) {
|
||||||
|
|
||||||
$image = '<a class="image" href="' . esc_url( $post->get_permalink() ) . '">' . $post->get_the_post_thumbnail( $atts['image_size'], $imageAttributes ) . '</a> ';
|
$image = '<a class="image" href="' . esc_url( $post->get_permalink() ) . '">' . $post->get_the_post_thumbnail( $atts['image_size'], $imageAttributes ) . '</a> ';
|
||||||
|
|
||||||
} elseif ( $atts['image_size'] && $post->has_post_thumbnail() ) {
|
} elseif ( $post->has_post_thumbnail() ) {
|
||||||
|
|
||||||
$image = '<span class="image">' . $post->get_the_post_thumbnail( $atts['image_size'], $imageAttributes ) . '</span> ';
|
$image = '<span class="image">' . $post->get_the_post_thumbnail( $atts['image_size'], $imageAttributes ) . '</span> ';
|
||||||
|
|
||||||
@@ -485,6 +487,8 @@ if ( ! class_exists( 'Display_Posts_Remote' ) ) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if ( $atts['include_date'] ) {
|
if ( $atts['include_date'] ) {
|
||||||
|
|
||||||
$date = ' <span class="date">' . $post->get_the_date( $atts['date_format'] ) . '</span>';
|
$date = ' <span class="date">' . $post->get_the_date( $atts['date_format'] ) . '</span>';
|
||||||
|
|||||||
Reference in New Issue
Block a user