#61423 closed defect (bug) (invalid)
Issue with returned url on wp_get_attachment_image_src using FSE
Reported by: | n0th | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.5.4 |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
Dear all
When you use the function wp_get_attachment_image_url on a FSE theme it turns out that when it returns the url and the image has the typical size information, the ‘x’ that separates the sizes is not the letter ‘x’, it is a multiplication symbol. They look the same but are not, which makes the address completely useless.
Expected behavior
Receive same information from a function does not matter the type of theme used.
Actual behavior
If you have a classic theme the output its ok, if you use a FSE theme the output its different.
Steps to reproduce
1.- Activate a FSE theme (Twenty Twnety-Four for example.
2.- Use the function to recevi thumbnails url for a resize image.
3.- Put the url receive into the browser to check that it does not exists due the x symbol.
Change History (7)
This ticket was mentioned in Slack in #core-test by mathieulamiotwpmedia. View the logs.
8 months ago
#4
@
8 months ago
I get the same results, it's working well on my side. Maybe I am missing something?
Here is the snippet I used:
$imgid = 23; //need to get it dynamically $imgurl = wp_get_attachment_image_src( $imgid, 'medium' ); //use custom set size error_log('Test MLT: '. $imgurl[0]);
I don't expect much differences between wp_get_attachment_image_src & wp_get_attachment_image_url based on wp_get_attachment_image_url code (see https://developer.wordpress.org/reference/functions/wp_get_attachment_image_url/)
Reproduction Report
Description
The reported issue could not be reproduced.
Environment
Actual Results
Additional Notes
It always returned URLs like: