apply_filters ( 'jetpack_photon_reject_https', bool $reject_https )

Allow Photon to fetch images that are served via HTTPS.

Source file: jetpack_vendor/automattic/jetpack-image-cdn/src/class-image-cdn.php

View in GitHub

Parameters

$reject_https

(bool) Should Photon ignore images using the HTTPS scheme. Default to false.


Changelog

Since: Jetpack 2.4.0


How to use this hook

See Using actions and filters to customize Jetpack.

Notes

By default, Jetpack’s Photon service will fetch and serve all images on your site, whether you use HTTP or HTTPS. You consequently do not need to use this filter to be able to use Photon on a site using HTTPS.

However, in some situations you may not want Jetpack to serve your HTTPS images. In such edge-cases, you can use this filter like so:

add_filter( 'jetpack_photon_reject_https', '__return_true' );

Have a note to contribute?

Comments

  1. Jay Prakash Kumar says:

    Where to add this filter

  2. Discount Flux says:

    when i enable “speed up image load time” button but button not enabled and when i enable button for image optimize and also show “updated” small popup on top-right side but when i refresh the page then again button show as disable. finally on my site jetpack not working properly

  3. diouldebalde says:

    Pourquoi mon premier image du site ne se désactive pas ?

  4. LĂ˝ Minh Nháş­t says:

    I use the filter in Snippet but the images still don’t load. In the end I need to disable the “Speed up image load times” option.

    Also, I wonder what that option really do? I see that it changes the srcset from http to https, and that’s all? How does using https link reduce loading time?

    • Dat Hoang says:

      Hi,

      Also, I wonder what that option really do? I see that it changes the srcset from http to https, and that’s all? How does using https link reduce loading time?

      You can find the answer in our “Notes” section above.

      • Using this filter so Jetpack Image CDN (formerly Photon) will not serve your HTTPS images. In other words, HTTPS images will from your site directly instead of our CDN.
      • This filter has nothing to do with reducing loading time. Due to some reasons, some users do not want to load their HTTP images, that’s why this filter exists.
      • In most cases, you do not need to use this filter. Please contact us as mentioned below so we can look at your site and advise.

      I use the filter in Snippet but the images still don’t load. In the end I need to disable the “Speed up image load times” option.

      Please contact us from https://jetpack.com/contact-support/ and let us know more info: why you need to use this filter, what your site is. We’re happy to discuss this with you further.