Title: Overriding a class function?
Last modified: August 22, 2016

---

# Overriding a class function?

 *  Resolved [Website Tutorials](https://wordpress.org/support/users/fakeartist/)
 * (@fakeartist)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/overriding-a-class-function/)
 * Hi. I want to override the **woocommerce_email_after_order_table**
    function 
   that resides in WCPGSK_Main class, in order to remove the dd and dt tags.
 * How is this possible? Any ideas?
 * I can succesfully remove the default function by using:
 *     ```
       add_action('init', 'my_plugins_override');
       function my_plugins_override() {
       global $wcpgsk;
       remove_action('woocommerce_email_after_order_table', array($wcpgsk, 'wcpgsk_email_after_order_table'));
       }
       ```
   
 * But I cannot redeclare it using:
 *     ```
       add_action('woocommerce_email_after_order_table', array($wcpgsk, 'wcpgsk_email_after_order_table_custom'));
   
       function wcpgsk_email_after_order_table_custom() {
       // change code here
       }
       ```
   
 * [https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/](https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [ulihake](https://wordpress.org/support/users/ulih/)
 * (@ulih)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/overriding-a-class-function/#post-5425369)
 * Hello fakeartist.
 * You cannot call a function in the plugin which does not exist… You have to call
   your function and to do so you have to call it without array($wcpgsk…). Call 
   your function directly ‘wcpgsk_email_after_order_table_custom’. That’s it. The
   rest is up to you. Please understand that I’m not able to help you with your 
   programming. This is far behind of what I can offer in the context of a free 
   plugin.
 * Regards.
    uh

Viewing 1 replies (of 1 total)

The topic ‘Overriding a class function?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-poor-guys-swiss-knife_ffffff.
   svg)
 * [WooCommerce Poor Guys Swiss Knife](https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [ulihake](https://wordpress.org/support/users/ulih/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/overriding-a-class-function/#post-5425369)
 * Status: resolved