Title: Title Mapping
Last modified: November 26, 2018

---

# Title Mapping

 *  Resolved [brandsforless](https://wordpress.org/support/users/brandsforless/)
 * (@brandsforless)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/title-mapping/)
 * Hello to all,
    in my xml file in the tags <NAME/> & <TYPE/> <name>Panties model
   102912 Róża</name> <type>Panties</type> some words it needs to be mapping in 
   my languange. in the above tags i want to map the word Panties in Greek languange.
   I realise that i have to use a php function as mapping is for custom fields and
   taxonomy. In the document i read about wpai_util_map function. Any example please?
 * Thank you in advance.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/title-mapping/#post-10923178)
 * Hi [@brandsforless](https://wordpress.org/support/users/brandsforless/)
 * Here’s an example mapping function that will allow you to easily define multiple
   rules:
 *     ```
       function my_translate_data( $data ) {
           $map = array(
               'Translate this'            => 'To this',
               'Add as many mapping rules' => 'As needed',
               'In this'                   => 'Array'
           );
           return ( array_key_exists( $data, $map ) ) ? $map[ $data ] : $data;
       }
       ```
   
 *  Thread Starter [brandsforless](https://wordpress.org/support/users/brandsforless/)
 * (@brandsforless)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/title-mapping/#post-10927585)
 * I write the function, save it to import at php function area and re-run the import
   again.
    Nothing change at all. I am sure that something i do wrong. My php function
   is this
 * function my_translate_data( $data ) {
    $map = array( ‘Shorts model’ => ‘Σορτσάκι’,‘
   ~Spodnie piżamowe’ => ‘Παντελόνι φόρμας’, ‘Blouse model’ => ‘Μπλούζα’, ‘Short
   skirt model’ => ‘Φούστα mini’, ‘Skirt model’ => ‘Φούστα’, ‘Singlet model’ => ‘
   Μπλουζάκι’, ‘Short dress model’ => ‘Φόρεμα mini’, ‘Evening dress model’ => ‘Φόρεμα
   βραδυνό’, ‘Top model’ => ‘Μπλουζάκι’, ‘Leggins model’ => ‘Κολάν’, ‘Daydress model’
   => ‘Φόρεμα καθημερινό’, ‘Long sleeve shirtmodel ‘ => ‘Πουκάμισο’, ‘Short sleeve
   shirt model’=> ‘Πουκάμισο’, ‘Cocktail dress model’ => ‘Φόρεμα cocktail’, ‘Trousers
   model’ => ‘Παντελόνι’, ‘Long leggings model’ => ‘Κολάν’, ‘Long dress model’ =
   > ‘Φόρεμα maxi’, ‘Suit model’ => ‘Φόρμα ολόσωμη’, ‘Jacket model’ => ‘Ζακέτα’ );
   return ( array_key_exists( $data, $map ) ) ? $map[ $data ] : $data; }
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/title-mapping/#post-10943431)
 * Hi [@brandsforless](https://wordpress.org/support/users/brandsforless/)
 * This code is correct:
 *     ```
       function my_translate_data( $data ) {
       	$map = array(
       	'Shorts model' 				=> 'Σορτσάκι',
       	'~Spodnie piżamowe' 		        => 'Παντελόνι φόρμας',
       	'Blouse model' 				=> 'Μπλούζα',
       	'Short skirt model' 		        => 'Φούστα mini',
       	'Skirt model' 				=> 'Φούστα',
       	'Singlet model' 			=> 'Μπλουζάκι',
       	'Short dress model' 		        => 'Φόρεμα mini',
       	'Evening dress model' 		        => 'Φόρεμα βραδυνό',
       	'Top model' 				=> 'Μπλουζάκι',
       	'Leggins model' 			=> 'Κολάν',
       	'Daydress model' 			=> 'Φόρεμα καθημερινό',
       	'Long sleeve shirtmodel' 	        => 'Πουκάμισο',
       	'Short sleeve shirt model' 	        => 'Πουκάμισο',
       	'Cocktail dress model' 		        => 'Φόρεμα cocktail',
       	'Trousers model' 			=> 'Παντελόνι',
       	'Long leggings model' 		        => 'Κολάν',
       	'Long dress model' 			=> 'Φόρεμα maxi',
       	'Suit model' 				=> 'Φόρμα ολόσωμη',
       	'Jacket model' 				=> 'Ζακέτα'
       	);
       	return ( array_key_exists( $data, $map ) ) ? $map[ $data ] : $data;
       }
       ```
   
 * But, keep in mind that you still have to call the function from within the import
   template: [http://www.wpallimport.com/documentation/developers/execute-php/](http://www.wpallimport.com/documentation/developers/execute-php/).
 * If this doesn’t help, please open a ticket at [http://www.wpallimport.com/support/](http://www.wpallimport.com/support/)
   so we can check what’s going wrong.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Title Mapping’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/title-mapping/#post-10943431)
 * Status: resolved