Skip to content

Instantly share code, notes, and snippets.

@thomasgriffin
Last active March 21, 2016 04:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thomasgriffin/971e2ebc33118ea49bdc to your computer and use it in GitHub Desktop.
Save thomasgriffin/971e2ebc33118ea49bdc to your computer and use it in GitHub Desktop.
Remove lightbox image sizes generated by OptinMonster.
<?php
add_filter( 'intermediate_image_sizes', 'tgm_om_filter_image_sizes' );
function tgm_om_filter_image_sizes( $sizes ) {
$om_sizes = array( 'optin-monster-lightbox-theme-balance', 'optin-monster-lightbox-theme-bullseye', 'optin-monster-lightbox-theme-case-study', 'optin-monster-lightbox-theme-clean-slate', 'optin-monster-lightbox-theme-transparent' );
foreach ( $sizes as $i => $size ) {
if ( in_array( $size, $om_sizes ) ) {
unset( $sizes[ $i ] );
}
}
return $sizes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment