vendredi 27 mars 2015

wp_get_attachment_image_src and server path


wp_get_attachment_image_src will give me URL and dimensions for an image.


But is there any way to get the server path for a scaled image (like /html/wordpress/wp-content/uploads/2015/03/cat-2-300x225.jpeg)? I know about get_attached_file but this returns only the original image.


I'd like to avoid hacky solutions (string-replacing domains and such) or using WP_Image_Editor directly. Also it should be multisite-proof. Is there something official I've just missed?





Aucun commentaire:

Enregistrer un commentaire