Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks
Embed::may_attempt_embed_fetch
Check whether an embed HTTP fetch may be performed and count the attempt. Enforces the MAX_EMBED_FETCHES cap shared by embed page fetches and oEmbed thumbnail lookups.
Метод класса: Embed{}
Хуков нет.
Возвращает
bool. True if the fetch is within the limit and may proceed.
Использование
// private - только в коде основоного (родительского) класса $result = $this->may_attempt_embed_fetch(): bool;
Код Embed::may_attempt_embed_fetch() Embed::may attempt embed fetch WC 11.2.2
private function may_attempt_embed_fetch(): bool {
if ( $this->embed_fetch_count >= self::MAX_EMBED_FETCHES ) {
return false;
}
++$this->embed_fetch_count;
return true;
}