Automattic\WooCommerce\Internal\ProductDownloads
DownloadableFileAttachments::is_hidden_attachment
Check whether an attachment is a downloadable product file the current user should not see.
Method of the class: DownloadableFileAttachments{}
No Hooks.
Returns
bool.
Usage
// private - for code of main (parent) class only $result = $this->is_hidden_attachment( $attachment_id ): bool;
- $attachment_id(int) (required)
- Attachment ID.
DownloadableFileAttachments::is_hidden_attachment() DownloadableFileAttachments::is hidden attachment code 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();
}