Automattic\WooCommerce\Internal\ProductDownloads
DownloadableFileAttachments::handle_oembed_response_data
Return no oEmbed data for downloadable product files, which would otherwise include the URL of an image file.
Method of the class: DownloadableFileAttachments{}
No Hooks.
Returns
array|false|mixed.
Usage
$DownloadableFileAttachments = new DownloadableFileAttachments(); $DownloadableFileAttachments->handle_oembed_response_data( $data, $post );
- $data(array|false|mixed) (required)
- oEmbed response data.
- $post(WP_Post|null|mixed) (required)
- Post the data was generated for.
DownloadableFileAttachments::handle_oembed_response_data() DownloadableFileAttachments::handle oembed response data code WC 11.3.0
public function handle_oembed_response_data( $data, $post ) {
return ( $post instanceof WP_Post && $this->is_hidden_attachment( $post->ID ) ) ? false : $data;
}