Looking to Override Jetpack Photon
-
Jetpack Photon automatically scales images and does not return the height and width of the image.
I have several sites, where our goal is, to have large, impressive images. If for some reason, the featured image is not available in high quality, full width, (lets say 640px wide), we don’t want to provide a “near hit” at full resolution, say 620px, but rather a smaller thumbnail (320max) and style the post different (Image inline with content, floating, rather than above it).
We have managed to do this while Jetpack is disabled, but when Jetpack is enabled, its filters prevent us from being able to get the width and height.
What I’m looking to do it to place a wrapper around any functions, like
image_downsize and get_post_thumbnail_id, to ignore ALL jetpack filters.$image_array = skip_jetpack(image_downsize($thumb_id, $size));
or
$image_array = skip_jetpack(“image_downsize”);If there any good way, of turning off jetpack’s filters for a small section of code only, I have tried removing filters, but since Jetpack uses non-statically called methods, it seems impossible to do without create a new jetpack instance. Could this be done by extending The Photon Class? or any other way?
- The topic ‘Looking to Override Jetpack Photon’ is closed to new replies.