Skip to content

Instantly share code, notes, and snippets.

@nosilver4u
Last active January 18, 2023 18:52
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 nosilver4u/7d3f3a94073dd668962f1071b824043c to your computer and use it in GitHub Desktop.
Save nosilver4u/7d3f3a94073dd668962f1071b824043c to your computer and use it in GitHub Desktop.
Force usage of fit vs. override when height/width attributes are not matching
<?php
/*
Plugin Name: Easy IO Fit Override
Version: 1.0.0
*/
add_filter( 'exactdn_post_image_args', 'easyio_force_fit_scale' );
function easyio_force_fit_scale( $args ) {
if ( ! empty( $args['resize'] ) ) {
$args['fit'] = $args['resize'];
unset( $args['resize'] );
}
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment