Automattic\WooCommerce\Internal\ProductDownloads
DownloadableFileAttachments::handle_comments_open
Close comments and pings on downloadable product files, which would otherwise list them in comment feeds.
Method of the class: DownloadableFileAttachments{}
No Hooks.
Returns
bool|mixed.
Usage
$DownloadableFileAttachments = new DownloadableFileAttachments(); $DownloadableFileAttachments->handle_comments_open( $open, $post_id );
- $open(true|false|mixed) (required)
- Whether comments or pings are open.
- $post_id(int|mixed) (required)
- Post ID.
DownloadableFileAttachments::handle_comments_open() DownloadableFileAttachments::handle comments open code WC 11.3.0
public function handle_comments_open( $open, $post_id ) {
return $this->is_downloadable_file( absint( $post_id ) ) ? false : $open;
}