What problem does it solve?
This skill guides plugin authors through declaring WooCommerce HPOS compatibility and adapting order data access to the HPOS backend to avoid breaking changes on WC 10.x.
Core Features & Use Cases
- Declare compatibility with FeaturesUtil::declare_compatibility on before_woocommerce_init to enable HPOS support flags.
- Use the WC Object model (wc_get_order, WC_Order::get_meta, update_meta_data, save) and wc_get_orders for all order CRUD and queries; avoid direct get_post_meta / WP_Query against orders.
- Detect runtime mode with OrderUtil helpers and properly branch admin hooks and screens for HPOS vs legacy CPT to maintain compatibility during migration or sync-mode.
- Prepare admin UI hooks and meta-box patterns using OrderUtil to ensure consistent screen handling across modes.
Quick Start
Declare HPOS compatibility using FeaturesUtil::declare_compatibility in the before_woocommerce_init hook and refactor all order interactions to wc_get_order, WC_Order::get_meta, and wc_get_orders.