I noticed that my older images are no longer getting resolved by Wordpress 5.3.4. - the file doesn't exist on that path and 404 gets returned.
For images that were originally uploaded to
https://www.example.com/wp-content/uploads/myimage-300x300.jpg
Wordpress now looks here
https://www.example.com/wp-content/uploads/sites/1/myimage-300x300.jpg
The function I'm using to resolve image path (none works with old images):
https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/
<img class="full-size" src="<?php echo get_the_post_thumbnail_url($row['ID'], "medium"); ?>">
https://developer.wordpress.org/reference/functions/the_post_thumbnail/
<?php the_post_thumbnail( 'medium' ); ?>
I'm using Wordpress Multisite for several years already and never had this problem. Before, the older images of the used to be directly in wp-content/uploads/
directory.
The change could either be part of a Wordpress update or a side effect of the newly installed Elementor plugin.
How to overcome this change?
! is_main_site()
.define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 2);
. Both site 1 and 2 are having this issue (old images not resolved).