wordpress.php 660 B

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