• Resolved lebac

    (@lebac)


    Hello,

    I have managed to activate plugin and it works fine. Considering buying pro version.

    Just one question: Is it still possible to somehow receive original image file while plugin is active (through .htaccess / webp)?

    If someone does “Save As” on image and can’t open WebP format in image editor is it possible to still get original in jpg/png format somehow?

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

    (@mateuszgbiorczyk)

    Hi @lebac,

    Thank you for your message.

    You can achieve the desired effect by using filters provided in plugins. I have prepared such a filter for you:

    add_filter( 'webpc_htaccess_mod_rewrite', function ( $rules ) {
    	return preg_replace(
    		'/(RewriteCond %{HTTP_ACCEPT} image\/(?:[a-z]+))/',
    		'$1' . PHP_EOL . '  RewriteCond %{QUERY_STRING} !(^|&)' . 'load-original' . ' [NC]',
    		$rules
    	);
    } );

    Please add this to the functions.php file in your theme directory and save the plugin settings again. To display an image in its original format, add the following suffix to the URL: ?load-original.

    Does this solve your problem?

    Best, Mateusz

    Thread Starter lebac

    (@lebac)

    Thank you for quick response!

    Script works great!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘While plugin active possible to get original images?’ is closed to new replies.