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
- The topic ‘Mapping via Functions Correct Code’ is closed to new replies.