woocommerce_orders_table_datastore_should_save_after_meta_change filter-hookWC 8.8.0

Allows code to skip a full order save() when metadata is changed.

Usage

add_filter( 'woocommerce_orders_table_datastore_should_save_after_meta_change', 'wp_kama_woocommerce_orders_table_datastore_should_save_after_meta_change_filter' );

/**
 * Function for `woocommerce_orders_table_datastore_should_save_after_meta_change` filter-hook.
 * 
 * @param bool $should_save Whether to trigger a full save after metadata is changed.
 *
 * @return bool
 */
function wp_kama_woocommerce_orders_table_datastore_should_save_after_meta_change_filter( $should_save ){

	// filter...
	return $should_save;
}
$should_save(true|false)
Whether to trigger a full save after metadata is changed.

Changelog

Since 8.8.0 Introduced.

Where the hook is called

OrdersTableDataStore::should_save_after_meta_change()
woocommerce_orders_table_datastore_should_save_after_meta_change
woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 3145
return apply_filters( 'woocommerce_orders_table_datastore_should_save_after_meta_change', $should_save );

Where the hook is used in WooCommerce

woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 666
add_filter( 'woocommerce_orders_table_datastore_should_save_after_meta_change', '__return_false' );
woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 668
remove_filter( 'woocommerce_orders_table_datastore_should_save_after_meta_change', '__return_false' );