default.php
1 year ago
generic.php
8 years ago
mappings.php
7 years ago
shopify.php
7 years ago
wordpress.php
8 years ago
wordpress.php
32 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WordPress mappings |
| 4 | * |
| 5 | * @package WooCommerce\Admin\Importers |
| 6 | */ |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | exit; |
| 10 | } |
| 11 | |
| 12 | /** |
| 13 | * Add mappings for WordPress tables. |
| 14 | * |
| 15 | * @since 3.1.0 |
| 16 | * @param array $mappings Importer columns mappings. |
| 17 | * @return array |
| 18 | */ |
| 19 | function wc_importer_wordpress_mappings( $mappings ) { |
| 20 | |
| 21 | $wp_mappings = array( |
| 22 | 'post_id' => 'id', |
| 23 | 'post_title' => 'name', |
| 24 | 'post_content' => 'description', |
| 25 | 'post_excerpt' => 'short_description', |
| 26 | 'post_parent' => 'parent_id', |
| 27 | ); |
| 28 | |
| 29 | return array_merge( $mappings, $wp_mappings ); |
| 30 | } |
| 31 | add_filter( 'woocommerce_csv_product_import_mapping_default_columns', 'wc_importer_wordpress_mappings' ); |
| 32 |