Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6118

    fastnetmedia
    Participant

    I have your Image Watermark plugin working great in
    WordPress. The plugin watermarks the images i upload… that’s
    great!

    BUT…

    I want to ADD Downloadable Files in
    WooCommerce products.

    The plugin also watermarks the
    DOWNLOADABLE file…. i upload,

    IS there any way i can stop the
    watermark being applied to The WOO Commerce DOWNLOADABLE file?

    I am ready to send you a donation if you can help this.
    I have server rights, and access to wordpress functions.php

    Kind Regards,
    Mark

    #6124

    Bartosz
    Keymaster

    Mark, I think you can try doing that already with the use of iw_watermark_display filter hook.

    Try copying that to functions.php of your theme.

    function custom_iw_watermark_display($attachment_id) {
    	// do this in admin only
    	if (is_admin()) {
    		// get uploaded file url
    		$attachment_link = get_attachment_link($attachment_id);
    		// check if file path points to woocommerce upload folder
    		if (strpos($attachment_link, 'woocommerce_uploads') !== false) {
    			// if it does, disable watermarking of this specific image
    		    $attachment_id = false;
    		}
    	}
    	return $attachment_id;
    }
    add_filters('iw_watermark_display', 'custom_iw_watermark_display');
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.