Title: Mapping via Functions Correct Code
Last modified: December 5, 2022

---

# Mapping via Functions Correct Code

 *  Resolved [Roman77](https://wordpress.org/support/users/roman77/)
 * (@roman77)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/mapping-via-functions-correct-code/)
 * Local Test Site
 * Hello, can you please advise what would be the correct code, can not seems to
   get it to work.
 * In my Real Estate Houzez theme, I have a Parent feature list with Sub Features
   underneath, Im trying to change the Import word from “Pool” to “HOA Community
   Pool”, I thought just changing the display name would work but the import adds
   a new subname with slug#2 instead, I thing the php code should work, below is
   what I’m using
 * The import comes in like this:
    CommunityFeatures[1]/item_3[1] CommunityFeatures[
   1]/item_3[2] CommunityFeatures[1]/item_3[3]
 * etc, etc, Im trying to tell the code that under Community Features parent, if“
   Pool” gets imported, display ” HOA Community Pool” instead, I do not know if 
   it will come in under line 1,2 or 3, its random
 * <?php
    function my_map_data( $data ) { $map = array( ‘CommunityFeatures[1]/item_3[
   Pool]’ => ‘HOA Community Pool’,
 *  );
    return ( array_key_exists( $data, $map ) ) ? $map[ $data ] : $data;
 * }
    ?>
 * Thank You

Viewing 1 replies (of 1 total)

 *  Thread Starter [Roman77](https://wordpress.org/support/users/roman77/)
 * (@roman77)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/mapping-via-functions-correct-code/#post-16263307)
 * Resolved, on CSV file, I just renamed that subcategory word with the one I want,
   can be done with a script within the CSV software. I was adding the function 
   on theme function file and seems that does not work..
    -  This reply was modified 3 years, 6 months ago by [Roman77](https://wordpress.org/support/users/roman77/).

Viewing 1 replies (of 1 total)

The topic ‘Mapping via Functions Correct Code’ 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/)

 * 1 reply
 * 1 participant
 * Last reply from: [Roman77](https://wordpress.org/support/users/roman77/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/mapping-via-functions-correct-code/#post-16263307)
 * Status: resolved