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.
Метод класса: DownloadableFileAttachments{}
Хуков нет.
Возвращает
array|false|mixed.
Использование
$DownloadableFileAttachments = new DownloadableFileAttachments(); $DownloadableFileAttachments->handle_oembed_response_data( $data, $post );
- $data(массив|false|разное) (обязательный)
- oEmbed response data.
- $post(WP_Post|null|разное) (обязательный)
- Post the data was generated for.
Код DownloadableFileAttachments::handle_oembed_response_data() DownloadableFileAttachments::handle oembed response data 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;
}