WC_Product_CSV_Importer_Controller::auto_map_user_preferences()publicWC 1.0

Map columns using the user's latest import mappings.

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

Хуков нет.

Возвращает

Массив.

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

$WC_Product_CSV_Importer_Controller = new WC_Product_CSV_Importer_Controller();
$WC_Product_CSV_Importer_Controller->auto_map_user_preferences( $headers );
$headers(массив) (обязательный)
Header columns.

Код WC_Product_CSV_Importer_Controller::auto_map_user_preferences() WC 8.7.0

public function auto_map_user_preferences( $headers ) {
	$mapping_preferences = get_user_option( 'woocommerce_product_import_mapping' );

	if ( ! empty( $mapping_preferences ) && is_array( $mapping_preferences ) ) {
		return $mapping_preferences;
	}

	return $headers;
}