Forked from thomasgriffin/gist:971e2ebc33118ea49bdc
Last active
August 29, 2015 14:14
-
-
Save ericakfranz/0a1ace703492ab552712 to your computer and use it in GitHub Desktop.
Unset images sizes for all OptinMonster optin themes, install as plugin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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