-
Couldn't load subscription status.
- Fork 6
Open
Description
I wanted just a bulleted list, no featured images.
[display-posts-remote image_size="false"]
Still had images. It looks like $atts['image_size'] isn't converted from the string "false" to the boolean. And even if it is, the following conditionals don't check it, only if $post->has_featured_media().
I changed the image markup section to this so I could disable images:
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> ';
} elseif ( $post->has_post_thumbnail() ) {
$image = '<span class="image">' . $post->get_the_post_thumbnail( $atts['image_size'], $imageAttributes ) . '</span> ';
} elseif ( $post->has_featured_media() && $atts['include_link'] ) {
$image = '<a class="image" href="' . esc_url( $post->get_permalink() ) . '">' . $post->get_the_post_thumbnail( 'full', $imageAttributes ) . '</a> ';
} elseif ( $post->has_featured_media() ) {
$image = '<span class="image">' . $post->get_the_post_thumbnail( 'full', $imageAttributes ) . '</span> ';
}
}
Metadata
Metadata
Assignees
Labels
No labels