• Resolved Nitin Rathod

    (@rnitinb)


    Hello,

    I have used your plugin for optimizing images and it works fantastic but I used popup to show the full image.

    When I enable the CDN setting for optimizing images it gives a modified URL of CDN URL but when a user clicks on images then it opens in popup but this gives my website’s image URL.

    Is there any function that gives me the CDN URL from my website’s URL?

    Ex: get_cdn_url($image_url); where $image_url is my website’s url.

    Please give me an update on this ASAP.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Well, something like below would work, but it’s based on an image tag, not on an image URL;

    $img_input = '<img src="https://localhost/wordpress/wp-content/uploads/2020/02/Selection_668-624x295.jpg"/>';
    $img_optimizer = new autoptimizeImages;
    $img_output = $img_optimizer->filter_optimize_images($img_input);

    hope this helps,
    frank

    Thread Starter Nitin Rathod

    (@rnitinb)

    Hello,

    Thank you for your quick response.

    Yes, it gets exactly what I want but I have just changed that code as per my requirement for getting just url.

    BTW, Thank you again for quick help.

    Regards.

    • This reply was modified 4 years, 6 months ago by Nitin Rathod.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome, feel free to leave a review of the plugin and support here! ??

    enjoy your Sunday!
    frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get CDN url from image url?’ is closed to new replies.