> $states All states by country. * * @return array> * * @internal Hooked callback. */ public function filter( array $states ): array { $provinces = LocationRepository::provinces(); if ( [] === $provinces ) { return $states; } // `array_replace` rather than assignment: if a future WooCommerce release // adds a province our dataset predates, keeping its English label beats // dropping the province entirely. $states['IR'] = array_replace( $states['IR'] ?? [], $provinces ); return $states; } }