Title: Help with hook example please
Last modified: August 2, 2022

---

# Help with hook example please

 *  Resolved [jayvee13](https://wordpress.org/support/users/jayvee13/)
 * (@jayvee13)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/help-with-hook-example-please/)
 * Hello,
 * Thank you for your awesome plugin. I’ve seen in your documentation that we can
   use the hook `peprodev_uploadreceipt_customer_uploaded_receipt` to change the
   order status.
 * I would like to set the status of both “awaiting receipt upload” and “awaiting
   receipt approval” to “on hold”.
 * Could you please provide an example code snippet of how to do that using your
   hook? I understand the concept, but I am still pretty new to PHP and it confuses
   me a bit.
 * I think if I see an example snippet, I’ll be able to figure out the rest though.
 * Thanks again for your awesome work. Have a great week!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Pepro Dev. Group](https://wordpress.org/support/users/peprodev/)
 * (@peprodev)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/help-with-hook-example-please/#post-15883471)
 * Hi, I hope you are doing well.
    The snippet you wanted:
 *     ```
       add_action( "peprodev_uploadreceipt_customer_uploaded_receipt", "peprodev_change_order_status", 10, 2);
       function peprodev_change_order_status($order_id, $attachment_id){
         $order = wc_get_order($order_id);
         $order->update_status("on-hold");
       }
       ```
   
 * Put this code at the end of the **function.php** file in your active theme’s 
   root folder.
 * if you enjoyed using our product, please consider giving us a five-star rating.
   
   Thank you.
    -  This reply was modified 3 years, 10 months ago by [Pepro Dev. Group](https://wordpress.org/support/users/peprodev/).
 *  Thread Starter [jayvee13](https://wordpress.org/support/users/jayvee13/)
 * (@jayvee13)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/help-with-hook-example-please/#post-15884369)
 * Thank you, I’ll give this a try and will be happy to leave you a rating.
 * Thanks again for your great plugin and support.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Help with hook example please’ is closed to new replies.

 * ![](https://ps.w.org/pepro-bacs-receipt-upload-for-woocommerce/assets/icon-256x256.
   png?rev=2398462)
 * [PeproDev WooCommerce Receipt Uploader](https://wordpress.org/plugins/pepro-bacs-receipt-upload-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pepro-bacs-receipt-upload-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pepro-bacs-receipt-upload-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/pepro-bacs-receipt-upload-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pepro-bacs-receipt-upload-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pepro-bacs-receipt-upload-for-woocommerce/reviews/)

## Tags

 * [order status](https://wordpress.org/support/topic-tag/order-status/)

 * 3 replies
 * 2 participants
 * Last reply from: [jayvee13](https://wordpress.org/support/users/jayvee13/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/help-with-hook-example-please/#post-15884369)
 * Status: resolved