Description of the bug
The core get_attached_file function is returning false when trying to retrieve an image that is in the global media library.
Reproduction instructions
- Attempt to get the path to the image using
get_attached_file( $image_id )
Expected behavior
Receive an image path in the response to get_attached_file( $image_id ).
Environment info
Standard WordPress multisite setup
Relevant log output
No response
Additional context
A customer has raised a compatibility issue with one of our products, and we're looking for insight into how we can patch this.
Naturally, the switch_to_blog approach isn't working as there is more going on here. Any advice welcome!
Code of Conduct
Description of the bug
The core
get_attached_filefunction is returningfalsewhen trying to retrieve an image that is in the global media library.Reproduction instructions
get_attached_file( $image_id )Expected behavior
Receive an image path in the response to
get_attached_file( $image_id ).Environment info
Standard WordPress multisite setup
Relevant log output
No response
Additional context
A customer has raised a compatibility issue with one of our products, and we're looking for insight into how we can patch this.
Naturally, the
switch_to_blogapproach isn't working as there is more going on here. Any advice welcome!Code of Conduct