woocommerce_orders_table_datastore_should_save_after_meta_change
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
woocommerce_orders_table_datastore_should_save_after_meta_change
woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 3563
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 822
add_filter( 'woocommerce_orders_table_datastore_should_save_after_meta_change', '__return_false' );
woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 824
remove_filter( 'woocommerce_orders_table_datastore_should_save_after_meta_change', '__return_false' );