Automattic\WooCommerce\Internal\ProductGallery
ProductMediaGallery::prime_attachment_caches
Prime attachment post caches for media gallery items.
Метод класса: ProductMediaGallery{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$result = ProductMediaGallery::prime_attachment_caches( $media_gallery, $include_posters ): void;
- $media_gallery(массив) (обязательный)
- Media gallery items.
- $include_posters(true|false)
- Whether to include resolved video poster IDs.
По умолчанию:false
Код ProductMediaGallery::prime_attachment_caches() ProductMediaGallery::prime attachment caches WC 11.3.0
public static function prime_attachment_caches( array $media_gallery, bool $include_posters = false ): void {
$attachment_ids = self::get_attachment_ids( $media_gallery, $include_posters );
if ( ! empty( $attachment_ids ) ) {
_prime_post_caches( $attachment_ids );
}
}