add action for webhook status change

This commit is contained in:
Caleb Stauffer 2017-11-03 11:37:00 -04:00
parent 482621a1de
commit 189aa66655
1 changed files with 5 additions and 0 deletions

View File

@ -773,7 +773,12 @@ class WC_Webhook {
break;
}
$prev_post_status = $this->get_status();
$wpdb->update( $wpdb->posts, array( 'post_status' => $post_status ), array( 'ID' => $this->id ) );
do_action( 'woocommerce_webhook_updated_status', $this->id, $post_status, $prev_post_status );
clean_post_cache( $this->id );
}