Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter hichloe

    (@hichloe)

    Hello again,

    I modified my code to use wp_get_attachment_url($id) instead of $attachment->guid… but this is not preferred because I’m calling another function to get the url instead of directly accessing the url value in the $attachment object.

    When using images in a gallery, accessing the object values is more efficient. Can you verify that your file URL replacement is replacing in all necessary metadata fields for the image?

    Thanks!

    We aren’t replacing any data on database so you have to use wp_get_attachment_url($id).
    Which function you have used to get attachment object. Maybe you can hook into some filter and replace the guid.

    You can try this method ud_get_stateless_media()->convert_to_gs_link($link);
    This convert link to GCS link. Or you can create your won function to do so. That would be faster. Or just use str_replace.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get file URL after replacement (string)’ is closed to new replies.