Automattic\WooCommerce\Internal\ProductDownloads
DownloadableFileAttachments::handle_rest_attachment_query
Mark REST API media collection queries to exclude downloadable product files.
Метод класса: DownloadableFileAttachments{}
Хуков нет.
Возвращает
array|mixed.
Использование
$DownloadableFileAttachments = new DownloadableFileAttachments(); $DownloadableFileAttachments->handle_rest_attachment_query( $args );
- $args(массив|разное) (обязательный)
- WP_Query arguments.
Код DownloadableFileAttachments::handle_rest_attachment_query() DownloadableFileAttachments::handle rest attachment query WC 11.3.0
public function handle_rest_attachment_query( $args ) {
if ( is_array( $args ) && ! $this->current_user_can_see_files() ) {
$args[ self::EXCLUDE_QUERY_VAR ] = true;
}
return $args;
}