Title: Getting &#8216;Function ID was called incorrectly&#8217;
Last modified: June 29, 2023

---

# Getting ‘Function ID was called incorrectly’

 *  Resolved [joncon62](https://wordpress.org/support/users/joncon62/)
 * (@joncon62)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/getting-function-id-was-called-incorrectly/)
 * Firstly a huge thank you for such a useful plugin I use it all the time to confirm
   tweaks to woo emails. I am getting the following error when choosing an order
   ID from the admin menu: **Function ID was called incorrectly**
 * It looks like you access ID directly in form.php, eg
 *     ```wp-block-code
       <option value="<?php echo $order->ID ?>" <?php selected( $order->ID, $this->orderID ); ?> >#order : <?php echo $order->ID; ?></option>
       ```
   
 * I believe ID should be accessed indirectly like this:
 *     ```wp-block-code
       $order->get_id();
       ```
   
 * Changing this fixes the errors.

Viewing 1 replies (of 1 total)

 *  Plugin Author [digamberpradhan](https://wordpress.org/support/users/digamberpradhan/)
 * (@digamberpradhan)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/getting-function-id-was-called-incorrectly/#post-16885377)
 * Hi [@joncon62](https://wordpress.org/support/users/joncon62/) ,
   Thank you for
   reporting this. I’ve updated the code to use the get function with version 2.1.4.

Viewing 1 replies (of 1 total)

The topic ‘Getting ‘Function ID was called incorrectly’’ is closed to new replies.

 * ![](https://ps.w.org/woo-preview-emails/assets/icon-256x256.png?rev=3019089)
 * [Preview E-mails for WooCommerce](https://wordpress.org/plugins/woo-preview-emails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-preview-emails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-preview-emails/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-preview-emails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-preview-emails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-preview-emails/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [digamberpradhan](https://wordpress.org/support/users/digamberpradhan/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/getting-function-id-was-called-incorrectly/#post-16885377)
 * Status: resolved