Last active
January 18, 2023 18:52
-
-
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
This file contains 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: 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