propertyhive / WP-Property-Hive

The complete estate agency software plugin for WordPress
Other
26 stars 27 forks source link

Cannot change the Property post title #263

Open kush1960 opened 2 days ago

kush1960 commented 2 days ago

I need the properties in my website to use a custom address format for the post title. I'm using the Foundations API Importer. Lokking through the code, this is where the title is assigned in class-ph-reapit-foundations-json-import.php

 if (!empty($property['strapline'])) {
                        $post_title = $property['strapline'];
                    } else {
                        $address_fields_array = array_filter(
                            array(
                                $property['address']['line1'],
                                $property['address']['line2'],
                                $property['address']['line3'],
                                $property['address']['line4'],
                                $property['address']['postcode'],
                            )
                        );

                        $post_title = implode(', ', $address_fields_array);
                    }

I was hoping to find a hook here, so I could set my own title logic, but I can't find anything. It makes no sense on my website to use the strap as the post title. And even if we were to use the address fallback, I need to customise the address format to show a partial postcode.

I'm writing a custom search component now, which illustrates the problem

image As you can see, the search results show the strap line which is useless in this context.

Could a hook be added? Or is there another workaround for this issue?

Many thanks.