feat: favoring preview_url over remote_url for image previews

This commit is contained in:
wolfgang101 2025-05-08 11:57:40 +02:00
parent f0de1ddd9b
commit 4ba567daa3
2 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@
Plugin Name: Include Mastodon Feed
Plugin URI: https://wolfgang.lol/code/include-mastodon-feed-wordpress-plugin
Description: Plugin providing [include-mastodon-feed] shortcode
Version: 1.10
Version: 1.11
Author: wolfgang.lol
Author URI: https://wolfgang.lol
License: MIT
@ -370,10 +370,7 @@ function init_scripts() {
if('image' == media.type) {
let mediaElemImgLink = mastodonFeedCreateElement('a');
let imageUrl = media.url;
if(null !== media.remote_url) {
imageUrl = media.remote_url;
}
else if('full' !== options.images.size && null !== media.preview_url) {
if('full' !== options.images.size && null !== media.preview_url) {
imageUrl = media.preview_url;
}
mediaElemImgLink.href = status.url;

View File

@ -5,7 +5,7 @@ Tags: mastodon, status, feed
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.10
Stable tag: 1.11
License: MIT
License URI: https://directory.fsf.org/wiki/License:Expat
@ -154,6 +154,9 @@ Use the following URL to get your ID:
== Changelog ==
= 1.11 =
* now favoring preview_url (smaler size) instead of remote_url (full size) for image previews (thank you @oldrup@mastodon.green)
= 1.10 =
* added image lazy loading for account and post images - post image lazy loading only works with preserveImageAspectRatio set to true (thank you @oldrup@mastodon.green)