Skip to content

Instantly share code, notes, and snippets.

@kloon
Created March 28, 2015 11:35
Show Gist options
  • Select an option

  • Save kloon/b9723a38d86636919da2 to your computer and use it in GitHub Desktop.

Select an option

Save kloon/b9723a38d86636919da2 to your computer and use it in GitHub Desktop.

Revisions

  1. kloon created this gist Mar 28, 2015.
    7 changes: 7 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <?php
    function wc_pdf_watermark_change_pdf_password( $order_id, $product_id ) {
    // Use the order number for the password instead of the billing email
    $order = wc_get_order( $order_id );
    return $order->get_order_number();
    }
    add_filter( 'woocommerce_pdf_watermark_file_password', 'wc_pdf_watermark_change_pdf_password' );