Customising the 'Add to shortlist' button label

If you wish to rename the 'Add to shortlist' and 'Remove from shortlist' button label, you can do so in one of two ways:

Option 1: Using the Template Assistant add on

Our free Template Assistant add on has a useful feature called 'Text Substitution' that allows you to change labels used throughout Property Hive.:

Option 2: Using a PHP snippet

A snippet like so will allow you to change the wording or, like in the example below, change it to the use an icon instead:

add_filter( 'gettext', 'propertyhive_change_shortlist_labels', 20, 3 );
function propertyhive_change_shortlist_labels( $translated_text, $text, $domain ) 
{
    switch ( $translated_text ) 
    {
        case 'Add To Shortlist':
        {
            return '<i class="far fa-heart"></i>'; // Heart outline. Requires FontAwesome
            break;
        }
        case 'Remove From Shortlist':
        {
            return '<i class="fas fa-heart"></i>'; // Filled heart. Requires FontAwesome
            break;
        }
    }
    
    return $translated_text;
}