Skip to content

Instantly share code, notes, and snippets.

@RyanNutt
Created May 26, 2020 20:30
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 RyanNutt/c36df6bfbbb4dcd907c48c5a088fd6e1 to your computer and use it in GitHub Desktop.
Save RyanNutt/c36df6bfbbb4dcd907c48c5a088fd6e1 to your computer and use it in GitHub Desktop.
WordPress plugin to turn off auto creation of scaled images
<?php
/**
* Plugin Name: Disable Scaled Images
* Plugin URI: https://www.nutt.net
* Description: One liner to turn off automatic scaled image creation for large images
* Version: 0.1.0
* Requires at least: 5.2
* Requires PHP: 7.2
* Author: Ryan Nutt
* Author URI: https://www.nutt.net
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*
* Really this could be added to your theme functions.php file, but I was working on a site that
* was using a stock theme and I didn't want to go through the effort of creating a child theme
* just for this one thing. Making a baby plugin seemed easier.
*/
add_filter('big_image_size_threshold', '__return_false');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment