Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_Webhook::is_valid_post_action( mixed $arg )
Validates post actions.
Description Description
Parameters Parameters
- $arg
-
(Required) First hook argument.
Return Return
(bool) True if validation passes.
Source Source
File: includes/class-wc-webhook.php
private function is_valid_post_action( $arg ) { // Only deliver deleted/restored event for coupons, orders, and products. if ( isset( $GLOBALS['post_type'] ) && ! in_array( $GLOBALS['post_type'], array( 'shop_coupon', 'shop_order', 'product' ), true ) ) { return false; } // Check if is delivering for the correct resource. if ( isset( $GLOBALS['post_type'] ) && str_replace( 'shop_', '', $GLOBALS['post_type'] ) !== $this->get_resource() ) { return false; } return true; }
Changelog Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |