Skip to content
Advertisement

Check if WooCommerce custom order status exist to execute code

I am creating woocommerce plugin and I have a custom order status “wc-shipped”. I want to execute some plugin options for this custom order status only. Here is my code

JavaScript

I want if “wc-shipped” status exist then show these plugin options but I am getting below error.

How to fix this ?

Advertisement

Answer

Your hooked function has 2 variables (arguments), so you need to declare those 2 variables replacing the first line of your code:

JavaScript

simply by:

JavaScript

This should solve this problem. See WordPress add_action()

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement