• Resolved uzdur

    (@uzdur)


    Hi,
    Your pluggin is very well but i need a function. We can seperate /upload folder inside? i dont want to convert to webp files in the /upload folder for example /upload/customers-uploads

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hello @uzdur,

    Thanks for your message.

    Do you want to exclude specific folders so that the image in those folders won’t be converted? This is possible and is described in the plugin FAQ.

    Best,
    Mateusz

    Thread Starter uzdur

    (@uzdur)

    thank you. is it right?

    add_filter( 'webpc_supported_source_directory', function( bool $status, string $directory_name, string $server_path ): bool {
        $excluded_directories = [ 'uploads/fancy_products_uploads' ];
        if ( ! $status || in_array( $directory_name, $excluded_directories ) ) {
            return false;
        }
    
        return $status;
    }, 10, 3 );
    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @uzdur This is correct:

    add_filter( 'webpc_supported_source_directory', function( bool $status, string $directory_name, string $server_path ): bool {
        $excluded_directories = [ 'fancy_products_uploads' ];
        if ( ! $status || in_array( $directory_name, $excluded_directories ) ) {
            return false;
        }
    
        return $status;
    }, 10, 3 );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘upload folder’ is closed to new replies.