Working on image sizes

This commit is contained in:
Eric van der Vlist 2025-03-22 18:40:43 +01:00
parent 7bd0d20e20
commit d2e4cfc5ff
2 changed files with 3 additions and 3 deletions

View File

@ -903,7 +903,7 @@ var WPGPXMAPS = {
if ( photos.length > 0 ) { if ( photos.length > 0 ) {
var photoLayer = L.photo.cluster().on( 'click', function( evt ) { var photoLayer = L.photo.cluster().on( 'click', function( evt ) {
var photo = evt.layer.photo; var photo = evt.layer.photo;
var template = '<img src="{url}" /></a><p>{name}</p>'; var template = '<img src="{url}" class= "size-thumbnails attachment-thunmnails" loading="lazy" decoding="async" /></a><p>{name}</p>';
evt.layer.bindPopup( L.Util.template( template, photo ), { evt.layer.bindPopup( L.Util.template( template, photo ), {
minWidth: 'auto' minWidth: 'auto'
}).openPopup(); }).openPopup();

View File

@ -22,10 +22,10 @@ function wpgpxmaps_getAttachedImages( $dt, $lat, $lon, $dtoffset, &$error ) {
$img_src = wp_get_attachment_image_src( $attachment_id, 'full' ); $img_src = wp_get_attachment_image_src( $attachment_id, 'full' );
$img_thmb = wp_get_attachment_image_src( $attachment_id, 'thumbnail' ); $img_thmb = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
$img_metadata = wp_get_attachment_metadata( $attachment_id ); $img_metadata = wp_get_attachment_metadata( $attachment_id );
$img_file = get_attached_file( $attachment_id, $unfiltered ); $img_file = get_attached_file( $attachment_id, false );
$item = array(); $item = array();
$item['data'] = wp_get_attachment_link( $attachment_id, array( 105, 105 ) ); $item['data'] = wp_get_attachment_link( $attachment_id, 'gpxmaps' );
if (!strpos('alt',$item['data'])) { if (!strpos('alt',$item['data'])) {
if (!empty(get_the_excerpt($attachment_id))) { if (!empty(get_the_excerpt($attachment_id))) {
$item['data'] = str_replace('src=','alt="' . esc_attr(get_the_excerpt($attachment_id)) . '" src=',$item['data']); $item['data'] = str_replace('src=','alt="' . esc_attr(get_the_excerpt($attachment_id)) . '" src=',$item['data']);