Automattic\WooCommerce\Internal\ProductDownloads

DownloadableFileAttachments::handle_get_the_guid │ public │ WC 1.0

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.

Метод класса: DownloadableFileAttachments{}

Хуков нет.

Возвращает

string|mixed.

Использование

$DownloadableFileAttachments = new DownloadableFileAttachments();
$DownloadableFileAttachments->handle_get_the_guid( $guid, $post_id );
$guid(строка|разное) (обязательный)
Post GUID.
$post_id(int|разное) (обязательный)
Post ID.

Код DownloadableFileAttachments::handle_get_the_guid() 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;
}