WC_Admin_Post_Types::upload_dir()publicWC 1.0

Устарела с версии 3.3.0 and moved to post-data class.. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Grant downloadable file access to any newly added files on any existing. orders for this product that have previously been granted downloadable file access.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$WC_Admin_Post_Types = new WC_Admin_Post_Types();
$WC_Admin_Post_Types->process_product_file_download_paths( $product_id, $variation_id, $downloadable_files );
$product_id(int) (обязательный)
product identifier.
$variation_id(int) (обязательный)
optional product variation identifier.
$downloadable_files(массив) (обязательный)
newly set files.

Список изменений

Устарела с 3.3.0 and moved to post-data class.

Код WC_Admin_Post_Types::upload_dir() WC 8.7.0

public function process_product_file_download_paths( $product_id, $variation_id, $downloadable_files ) {
	wc_deprecated_function( 'WC_Admin_Post_Types::process_product_file_download_paths', '3.3', '' );
	WC_Post_Data::process_product_file_download_paths( $product_id, $variation_id, $downloadable_files );
}

/**
 * When editing the shop page, we should hide templates.
 *
 * @param array   $page_templates Templates array.
 * @param string  $theme Classname.
 * @param WP_Post $post The current post object.
 * @return array
 */
public function hide_cpt_archive_templates( $page_templates, $theme, $post ) {
	$shop_page_id = wc_get_page_id( 'shop' );

	if ( $post && absint( $post->ID ) === $shop_page_id ) {
		$page_templates = array();
	}