ACF\Pro\Forms

WC_Order::skip_post_save_for_orders │ public │ ACF 6.8.6

Prevents ACF_Form_Post from saving order posts so that save_order() remains the single save entry-point. Without this, the backfill triggered by WooCommerce Compatibility Mode fires save_post before woocommerce_update_order, consuming the ACF nonce and causing save_order() to bail.

Method of the class: WC_Order{}

No Hooks.

Returns

boolean.

Usage

$WC_Order = new WC_Order();
$WC_Order->skip_post_save_for_orders( $skip, $post_id, $post );
$skip(true|false) (required)
Whether to skip the save.
$post_id(int) (required)
The post ID being saved.
$post(WP_Post) (required)
The post being saved.

Changelog

Since 6.8.6 Introduced.

WC_Order::skip_post_save_for_orders() code ACF 6.8.8

public function skip_post_save_for_orders( $skip, $post_id, $post ) {
	if ( in_array( $post->post_type, array( 'shop_order', 'shop_subscription' ), true ) ) {
		return true;
	}

	return $skip;
}