"Largest new upload WordPress uses on pages" chooses that size or keeps the full * picture, through WordPress's own filter big_image_size_threshold. Only new uploads; nothing in the library changes. * * @package AffStackDevImageManager */ namespace AffStackDev\ImageManager; if ( ! defined( 'ABSPATH' ) ) { exit; } /** WordPress's big-upload threshold as a setting. */ final class Upload_Limit { /** The choices: WordPress's own value (2,560 or what another plugin sets), off (no scaled copy), or a size in pixels. */ const CHOICES = array( 'wordpress', 'off', '1920', '2048', '3200', '3840', '5120' ); /** * The threshold for this upload. * * @param int|false $threshold WordPress's value so far. * @return int|false */ public static function threshold( $threshold ) { $choice = (string) ( Settings::get()['upload_limit'] ?? '' ); if ( 'off' === $choice ) { return false; } // A size in pixels; the first choice (WordPress's own value) and anything unknown leave WordPress's value. return ctype_digit( $choice ) && in_array( $choice, self::CHOICES, true ) ? (int) $choice : $threshold; } }