Automattic\WooCommerce\Internal\Admin
OrderMilestoneEasterEgg::get_cached_milestone_order_ids
Returns cached milestone order IDs, or null when the cache is missing.
Метод класса: OrderMilestoneEasterEgg{}
Хуков нет.
Возвращает
array<string, int>|null.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_cached_milestone_order_ids(): ?array;
Код OrderMilestoneEasterEgg::get_cached_milestone_order_ids() OrderMilestoneEasterEgg::get cached milestone order ids WC 11.2.2
private function get_cached_milestone_order_ids(): ?array {
$cached = get_option( self::MILESTONE_CACHE_OPTION, null );
if ( ! is_array( $cached ) ) {
return null;
}
$milestone_order_ids = array();
foreach ( self::MILESTONE_POSITIONS as $key ) {
if ( isset( $cached[ $key ] ) ) {
$order_id = absint( $cached[ $key ] );
if ( $order_id > 0 ) {
$milestone_order_ids[ $key ] = $order_id;
}
}
}
return $milestone_order_ids;
}