epl_elementor_property_status_label: change the Status widget label

Description #

Filters the label the Elementor Status widget shows for a listing, such as "For Sale", "Under Offer" or "Sold". Return an empty string to show nothing for that listing.

The widget picks the label from its own settings: for a current listing, Under Offer when property_under_offer is yes, otherwise the sale, rental or commercial label (commercial uses property_com_listing_type: lease, both or sale); for any other status, that status's label. EPL escapes the label when it prints it.

Part of the Elementor integration, which is in beta. See Elementor widgets and templates (beta) for how the widgets and templates fit together.


Usage #

add_filter( 'epl_elementor_property_status_label', 'my_function', 10, 4 );

Parameters #

$label (string)
The label from the widget's settings.

$status (string)
The listing's property_status, for example current, sold, leased, withdrawn or offmarket. current when the listing has none. It stays current for listings under offer.

$property (EPL_Property_Meta)
The listing.

$settings (array)
The widget's settings.


Examples #

Show "Rented" instead of the Leased label:

function my_epl_status_label( $label, $status, $property, $settings ) {
	if ( 'leased' === $status ) {
		return 'Rented';
	}
	return $label;
}
add_filter( 'epl_elementor_property_status_label', 'my_epl_status_label', 10, 4 );

Source #

lib/page-builders/elementor/widgets/elements/class-epl-elementor-property-status.php, in EPL_Elementor_Property_Status::render(). Since 3.6.