1. WooCommerce Discontinued Products
  2. Developer Documentation

Actions and Filters

WooCommerce Discontinued Products comes with a number of filters which allow you to customize the plugin's behavior.
Please note that this code is aimed at developers and if you don't know how to use it then you should ask your developer.

We've partnered with Codeable to provide our customers with expert help if required.

Actions

wdp_before_ajax_variations_discontinued

This action is fired once before all variations of a variable product are discontinued by pressing the "Discontinue all variations" button. It receives one argument: string the id number of the product for which variations are being discontinued.

wdp_after_ajax_variations_discontinued

This action is fired once after all variations of a variable product are discontinued by pressing the "Discontinue all variations" button. It receives two arguments.WC_Product_Variable The product's object and an array with the list of all variations found.

wdp_after_discontinue_variations_btn

Allows developers to add custom content after the "Discontinue all variations" button.

wdp_before_set_discontinued_products_to_outofstock

This action is fired once before all discontinued products are queried and their stock status is changed to out of stock.

wdp_after_set_discontinued_products_to_outofstock

This action is fired once after all discontinued products are queried and after their stock status has been changed to out of stock. It receives two arguments: an array of discontinued products and an array with all individual discontinued variations.

wdp_before_set_outofstock_products_back_to_discontinued

This action is fired once before all the previously discontinued and currently out of stock - products are queried and their stock status is changed back to discontinued.

wdp_after_set_outofstock_products_back_to_discontinued

This action is fired once after all the out of stock products have had their stock status changed back to discontinued. It receives 3 arguments: an array of previously out of stock products, an array with all the previously out of stock variations and an array with variable products.

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.