The filter appears to work well on my end, when used to exclude specific images.
For example if the directory contains ‘abc’, ‘asd’ or ‘xyz’ I would want to exclude it from Photon, but include all others.
Something like this works in my tests:
function jeherve_skip_photon( $val, $src, $tag ) {
if ( stripos( $src, 'abc' ) ) {
return true;
}
return $val;
}
add_filter( 'jetpack_photon_skip_image', 'jeherve_skip_photon', 10, 3 );
If that doesn’t seem to work on your end, could you post a link to a page where you have the issue, as well as the code you used to try to exclude the image?
Thanks!
function jeherve_skip_photon( $val, $src, $tag ) {
if ( stripos( $src, '2015' ) ) {
return true;
}
return $val;
}
add_filter( 'jetpack_photon_skip_image', 'jeherve_skip_photon', 10, 3 );
Is there a way to send the link to you privately?
-
This reply was modified 9 years, 1 month ago by
aaron843.
You can send us more details via this contact form:
http://jetpack.com/contact-support/
Sent.
Let me also add the following observations:
jetpack_photon_skip_image does seem to be working correctly with regard to src inside the img tag. However, all sizes of the image are still being copied to the wordpress servers and being made publicly available (for example, the URL in data-large-file); this is the activity I would like to stop.
However, all sizes of the image are still being copied to the wordpress servers and being made publicly available (for example, the URL in data-large-file); this is the activity I would like to stop.
We’ll take a look at the example you sent us via email, and we’ll help you figure this out!