Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericakfranz/0a1ace703492ab552712 to your computer and use it in GitHub Desktop.
Save ericakfranz/0a1ace703492ab552712 to your computer and use it in GitHub Desktop.
Unset images sizes for all OptinMonster optin themes, install as plugin.
<?php
/**
* Plugin Name: OptinMonster Unset Images Sizes
* Plugin URI: http://optinmonster.com/
* Description: Disable the custom image sizes used in the OptinMonster themes. Optins will use full image size instead.
* Version: 1.0.0
* Author: Erica Franz
* Author URI: https://fatpony.me/
* License: GPL2
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
add_filter( 'intermediate_image_sizes_advanced', 'ekf_om_filter_image_sizes' );
function ekf_om_filter_image_sizes( $sizes ) {
// Unset Lightbox theme image sizes
unset( $sizes['optin-monster-lightbox-theme-balance'] );
unset( $sizes['optin-monster-lightbox-theme-bullseye'] );
unset( $sizes['optin-monster-lightbox-theme-case-study'] );
unset( $sizes['optin-monster-lightbox-theme-clean-slate'] );
unset( $sizes['optin-monster-lightbox-theme-pendleton'] );
unset( $sizes['optin-monster-lightbox-theme-transparent'] );
// Unset After Post theme image sizes
unset( $sizes['optin-monster-post-theme-banner'] );
unset( $sizes['optin-monster-post-theme-fabric'] );
unset( $sizes['optin-monster-post-theme-postal'] );
// Unset Sidebar theme image sizes
unset( $sizes['optin-monster-sidebar-theme-banner'] );
unset( $sizes['optin-monster-sidebar-theme-fabric'] );
unset( $sizes['optin-monster-sidebar-theme-postal'] );
return $sizes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment