Created
April 19, 2018 20:25
-
-
Save Garconis/6dee59fe98bbd7ac2b37424496b2683d to your computer and use it in GitHub Desktop.
WordPress | WPMU Smush resize only for non-admin users
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 | |
// resize only for non-admin | |
add_filter( 'wp_smush_resize_uploaded_image', 'smush_resize_non_admin', 10, 3 ); | |
function smush_resize_non_admin($should_resize, $id, $meta) { | |
global $current_user; | |
if ( current_user_can('manage_options') ) { | |
return false; | |
} | |
return $meta; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note, this code was provided to me by WPMU DEV support. I have not tested it.