I'd like to get the name of an intermediate file based on it's original attachment without relying on its post meta. As the registered image sizes e.g. thumbnail have been unregistered, the post meta is unreliable.
For example, if the attachment is named test.jpg
and when it's uploaded, it typically generates the filename test-106x150.jpg
If I use wp_get_attachment_image_src( $attachment_id, 'thumbnail')
, it returns an array like so:
[0] => https://domain.com/wp-content/uploads/2023/06/test.jpeg
[1] => 106
[2] => 150
[3] =>
I was hoping it would be:
[0] => https://domain.com/wp-content/uploads/2023/06/test-106x150.jpg
[1] => 106
[2] => 150
[3] =>
Is there another way?
thumbnail
? Your last question suggests you might have, but you didn't mention it here. Please include all relevant information in the question.wp_get_attachment_image_src
withthumbnail
even though you've unregistered it? Why? Why is it unregistered if you want to use it?