', \esc_attr($slot), $attributes ? ' ' . implode(' ', array_map('esc_attr', $attributes)) : '' ); } /** * @return bool */ private static function available(string $slot) { if (!Slots::isKnown($slot)) { return false; } // A persistent cache would carry the answer into requests where the // trigger no longer passes. \wp_cache_add_non_persistent_groups(self::MEMO_GROUP); $memoized = false; $memo = \wp_cache_get($slot, self::MEMO_GROUP, false, $memoized); if ($memoized) { return (bool) $memo; } // Up to three hooks ask for the same slot in one request. $available = Availability::anyIn($slot, NotificationData::get()); \wp_cache_set($slot, $available, self::MEMO_GROUP); return $available; } }