Automattic\WooCommerce\Internal\ProductDownloads
DownloadableFileAttachments::is_hidden_attachment
Check whether an attachment is a downloadable product file the current user should not see.
Метод класса: DownloadableFileAttachments{}
Хуков нет.
Возвращает
bool.
Использование
// private - только в коде основоного (родительского) класса $result = $this->is_hidden_attachment( $attachment_id ): bool;
- $attachment_id(int) (обязательный)
- Attachment ID.
Код DownloadableFileAttachments::is_hidden_attachment() DownloadableFileAttachments::is hidden attachment WC 11.3.0
private function is_hidden_attachment( int $attachment_id ): bool {
return $this->is_downloadable_file( $attachment_id ) && ! $this->current_user_can_see_files();
}