Hi @sclosson,
Thanks for your message.
The configuration for Nginx should also work for Multisite mode. Try them out and let us know if you’ve made it.
Hey, thanks got it working, and just left it at via .htaccess in the Settings. Hope that isn’t a problem, converted all current images in the Media Library, haven’t uploaded any yet, but looking at the mime-types of the images, they are set to webp so I’m super excited and seems like the site is loading 5x faster now!
Had to add some filters here, hopefully just the dir paths need to be changed and not the url paths:
add_filter('webpc_uploads_root', function($path) {
return '/www/';
});
add_filter('webpc_dir_path', function($path, $directory) {
if ($directory !== 'webp') {
return '/www/wp-content/uploads';
}
return '/www/wp-content/uploads-webpc';
}, 10, 2);
I am happy to @sclosson!
Use the following filters:
add_filter( 'webpc_uploads_root', function( $path ) {
return '/www/';
} );
add_filter( 'webpc_dir_path', function( $path, $directory ) {
switch ($directory) {
case 'uploads':
return '/www/wp-content/uploads';
case 'webp':
return '/www/wp-content/uploads-webpc';
}
return $path;
}, 10, 2 );
Filter webpc_dir_path can use different $directory values: uploads, plugins, themes, or webp.
Wow, awesome. Thanks so much! You ROCK!
In this case the path is symbolic or should I put the correct path that my wordpress is installed in?
where I have to add the following filters
add_filter( 'webpc_uploads_root', function( $path ) {
return '/www/';
} );
add_filter( 'webpc_dir_path', function( $path, $directory ) {
switch ($directory) {
case 'uploads':
return '/www/wp-content/uploads';
case 'webp':
return '/www/wp-content/uploads-webpc';
}
return $path;
}, 10, 2 );