Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

please change the following in the optimizeAfterUpload function #1

Open
ash2osh opened this issue Dec 27, 2017 · 0 comments
Open

please change the following in the optimizeAfterUpload function #1

ash2osh opened this issue Dec 27, 2017 · 0 comments

Comments

@ash2osh
Copy link

ash2osh commented Dec 27, 2017

function optimizeAfterUpload( $data )
{

if (get_option('autoopt') === 'yes') {
    $path   = wp_upload_dir();
	$base_dir = $path['basedir'];
    $dir    = $path['path'];
    $sizes  = getSizes();
	
	//optimize orig
	$orig = $base_dir.'/'.$data['file'];
	 optimizeImage($orig);

    foreach ($sizes AS $size) {
		echo $size;
        if (get_option($size) === 'yes' && isset($data['sizes'][$size]['file'])) {
            $file = $dir.'/'.$data['sizes'][$size]['file'];
			echo $file;
            optimizeImage($file);
        }
    }
}

return $data;

}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant