Customizing ExactDN

While ExactDN is designed to be pretty much automatic, it has a ton of filters that will allow developers to customize it's behavior. If you're familiar with Jetpack's Photon module, you'll see pretty much all the same filters, and likely a few extras. I'll try to flesh these out more in the coming weeks, but here's the list for now (they are fully documented in the class-exactdn.php file):

exactdn_content_width - Many themes define a global $content_width variable (in pixels), which ExactDN will use to constrain images found in page/post content, use this filter to override that global setting.

exactdn_skip_image - Defaults to false, second parameter is usually the image url, third depends on whether it comes from the content filter, or the srcset filter.

exactdn_post_image_args - Filter the array of ExactDN arguments added to an image, which by default, only includes width and height values.

exactdn_admin_allow_image_downsize - While themes and plugins generally use the image_downsize() function, the WP admin also uses it liberally, but ExactDN is turned off in the WP admin by default (false).

exactdn_override_image_downsize - Provide plugins a way of preventing ExactDN from being applied to images retrieved from WordPress Core. By returning true, the image_downsize filter will terminate immediately.

exactdn_image_downsize_string - Filter the ExactDN arguments added to an image when that image size is a string. For example, when $size is 'full', 'medium', etc.

exactdn_image_downsize_array - Filter the ExactDN arguments added to an image, when the image size is an array of height and width values.

exactdn_admin_allow_image_srcset - Provide plugins a way of running ExactDN for the srcset attribute of images in the WordPress Dashboard (wp-admin).

exactdn_srcset_multipliers - Filter the multipliers ExactDN uses to create new srcset items. Return false to short-circuit and bypass auto-generation.

exactdn_reject_https - Tells ExactDN to ignore/reject images that are served via HTTPS. Defaults to false, set to true to only rewrite non-encrypted image communication.

exactdn_validate_image_url - Overwrite the results of the previous validation steps an image goes through to be considered valid for ExactDN.

exactdn_development_mode - Disables ExactDN URL processing for local development. Defaults to false.

exactdn_skip_for_url - Allow specific image URls to avoid going through ExactDN (in case exactdn_skip_image didn't work for you).

exactdn_pre_image_url - Filter the original image URL before it goes through ExactDN.

exactdn_pre_args - Filter the ExactDN image parameters before they are applied to an image.

Still need help? Contact Us Contact Us