* In order for the waitlist counts on the product listings in admin to be accurate for variable products,
                 * we need to total up the number of waitlist registrations for their child product variations. We do this
                 * by adding the parent variable product id to the $updated_products array used below through the
                 * wcwl_updated_variable_products filter every time a waitlist is changed for a WC_Product_Variation.
                 *
                 * We then loop through this array and combine all the waitlist registrations for child products into one
                 * waitlist entry attached to the parent product
                 *
                 * @hooked shutdown
                 * @static
                 * @access public
                 * @return void
                 * @since 1.1.0
                 */
                public static function update_variable_product_waitlist_counts()
                {
                    $updated_products = apply_filters('wcwl_updated_variable_products', array());
                    foreach (array_unique($updated_products) as $product_id) {
                        $waitlist = array();
                        $product = get_product($product_id);
                        foreach ($product->get_children() as $child_id) {
                            $waitlist = array_merge($waitlist, get_post_meta($child_id, WCWL_SLUG, true));
                        }
                        update_post_meta($product_id, WCWL_SLUG, $waitlist);
                    }
                }
            }
            WooCommerce_Waitlist_Plugin::init();
        }
    }
}