Automattic\WooCommerce\Internal\ProductDownloads
DownloadableFileAttachments::handle_get_the_guid
Use the ID-only link as the GUID of downloadable product files, which is otherwise the file's URL.
Comment feeds print the GUID of the post each comment belongs to.
Method of the class: DownloadableFileAttachments{}
No Hooks.
Returns
string|mixed.
Usage
$DownloadableFileAttachments = new DownloadableFileAttachments(); $DownloadableFileAttachments->handle_get_the_guid( $guid, $post_id );
- $guid(string|mixed) (required)
- Post GUID.
- $post_id(int|mixed) (required)
- Post ID.
DownloadableFileAttachments::handle_get_the_guid() DownloadableFileAttachments::handle get the guid code WC 11.3.0
public function handle_get_the_guid( $guid, $post_id ) {
$post_id = absint( $post_id );
return $this->is_hidden_attachment( $post_id ) ? add_query_arg( 'attachment_id', $post_id, home_url( '/' ) ) : $guid;
}